start couchbot via script (for debugging)
1 files changed, 17 insertions(+), 10 deletions(-)

M CMakeLists.txt
M CMakeLists.txt +17 -10
@@ 47,14 47,20 @@ endif()
 
 find_package(PythonInterp 2.7 REQUIRED)
 
-if (COUCHBOT_PASSWORD STREQUAL "NOT SET")
+set(KRONOS_REPOSITORY "https://hg.sr.ht/~vnorilo/kronos" CACHE STRING "Master repostiory for Kronos")
+set(KRONOS_INTEGRATION_SERVER "" CACHE STRING "Optional CouchDB Database for continuous integration")
+
+if (KRONOS_INTEGRATION_SERVER STREQUAL "")
 	message(STATUS "CouchBot credentials not entered. Configuring a simple SuperBuild")
 	externalproject_add(kronos 
-		HG_REPOSITORY https://bitbucket.org/vnorilo/k3
+		HG_REPOSITORY ${KRONOS_REPOSITORY}
 		CMAKE_ARGS ${KRONOS_CMAKE_ARGS}
 		LIST_SEPARATOR ::
 		DEPENDS ${KRONOS_BUILD_DEPS})
 else()
+	set(KRONOS_INTEGRATION_USER "" CACHE STRING "CouchDB username")
+	set(KRONOS_INTEGRATION_PASSWORD "" CACHE STRING "CouchDB password")
+
 	message(STATUS "CouchBot credentials entered; starting BuildBot mode")
 
 	set(COUCHBOT_CONFIG_FILE ${CMAKE_BINARY_DIR}/couchbot.json)

          
@@ 71,10 77,10 @@ else()
 	set(COUCHBOT_CMAKE_ARGS "[\"${COUCHBOT_CMAKE_ARGS}\"]")
 
 	file(WRITE ${CMAKE_BINARY_DIR}/config-template.json.in [=[{
-		"remote": "vnorilo/k3",
-		"buildmaster": "https://db.kronoslang.io/ci",
-		"user": "${COUCHBOT_USER}",
-		"passwd": "${COUCHBOT_PASSWORD}",
+		"database": "${KRONOS_INTEGRATION_SERVER}",
+		"remote": "${KRONOS_REPOSITORY}",
+		"user": "${KRONOS_INTEGRATION_USER}",
+		"passwd": "${KRONOS_INTEGRATION_PASSWORD}",
 		"cmake_args": ${COUCHBOT_CMAKE_ARGS},
 		"artifacts": ["*.msi", "*.pkg", "*.deb", "test_run.json"]
 	}]=])

          
@@ 85,11 91,12 @@ else()
 		HG_REPOSITORY https://bitbucket.org/vnorilo/couchbot
 		BUILD_COMMAND "" INSTALL_COMMAND "" CONFIGURE_COMMAND "")
 
+	file(WRITE ${CMAKE_BINARY_DIR}/couchbot.sh
+		"echo Launching Couchbot\n${PYTHON_EXECUTABLE}  \"${BUILD_PREFIX}/Source/couchbot/couchbot.py\" \"${COUCHBOT_CONFIG_FILE}\"")
+
 	add_custom_target(kronos ALL
-		COMMAND
-			"${PYTHON_EXECUTABLE}" 
-			"${BUILD_PREFIX}/Source/couchbot/couchbot.py"
-			"${COUCHBOT_CONFIG_FILE}"
+		COMMAND ${CMAKE_BINARY_DIR}/couchbot.sh
+		COMMENT "Running CouchBot"
 		DEPENDS ${KRONOS_BUILD_DEPS} couchbot
 		WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
 		VERBATIM)