diff --git a/CMakeModules/prepare_version_tag.cmake b/CMakeModules/prepare_version_tag.cmake index 4a29f6bbf6c3fcfc586bacb228a396b90f7c8174..1a1517517eeb6f1a02b3d17c2774244c1067bb5e 100644 --- a/CMakeModules/prepare_version_tag.cmake +++ b/CMakeModules/prepare_version_tag.cmake @@ -1,45 +1,33 @@ +function(cleanup varname) + string (REPLACE "-" "_" out ${${varname}}) + SET( ${varname} ${out} PARENT_SCOPE) +endfunction() + execute_process(COMMAND git describe --tags --abbrev=0 - OUTPUT_VARIABLE VERSION + OUTPUT_VARIABLE ASAPO_TAG WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) -string(STRIP ${VERSION} VERSION) +string(STRIP ${ASAPO_TAG} ASAPO_TAG) execute_process(COMMAND git rev-parse --abbrev-ref HEAD OUTPUT_VARIABLE BRANCH WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) string(STRIP ${BRANCH} BRANCH) - -if (${BRANCH} STREQUAL "master") - SET (ASAPO_VERSION ${BRANCH}.${VERSION}) -else() - SET (ASAPO_VERSION ${BRANCH}.latest) -endif() +cleanup(BRANCH) execute_process(COMMAND git rev-parse --short HEAD - OUTPUT_VARIABLE VERSION_COMMIT - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) -string(STRIP ${VERSION_COMMIT} VERSION_COMMIT) - -function(cleanup varname) - string (REPLACE "-" "_" out ${${varname}}) - SET( ${varname} ${out} PARENT_SCOPE) -endfunction() - -cleanup(BRANCH) + OUTPUT_VARIABLE ASAPO_VERSION_COMMIT + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) +string(STRIP ${ASAPO_VERSION_COMMIT} ASAPO_VERSION_COMMIT) if (${BRANCH} STREQUAL "master") + SET (ASAPO_VERSION ${ASAPO_TAG}) + SET (ASAPO_VERSION_COMMIT "") SET (ASAPO_VERSION_DOCKER_SUFFIX "") else() + SET (ASAPO_VERSION ${BRANCH}) + SET (ASAPO_VERSION_COMMIT ", build ${ASAPO_VERSION_COMMIT}") SET (ASAPO_VERSION_DOCKER_SUFFIX "-dev") endif() - - -if (${BRANCH} STREQUAL "master") - SET (ASAPO_VERSION_PYTHON ${ASAPO_VERSION}) -else() - SET (ASAPO_VERSION_PYTHON ${ASAPO_VERSION}.${BRANCH}.latest) -endif() - - message("Asapo Version: " ${ASAPO_VERSION}) -message("Asapo Version Python: " ${ASAPO_VERSION_PYTHON}) +message("Asapo commit: " ${ASAPO_VERSION_COMMIT}) diff --git a/common/cpp/include/common/version.h.in b/common/cpp/include/common/version.h.in index 1ca92fd870aeecf79f17f29907c7b3d452cee070..cfb735d837ece16c9a92c11dc09900390a1b4e3e 100644 --- a/common/cpp/include/common/version.h.in +++ b/common/cpp/include/common/version.h.in @@ -6,7 +6,7 @@ namespace asapo { -const char kVersion[] = "@VERSION@"; +const char kVersion[] = "@ASAPO_VERSION@@ASAPO_VERSION_COMMIT@"; inline void ExitAfterPrintVersionIfNeeded(std::string prefix,int argc, char* argv[]) { if (argc == 2 && strcmp(argv[1], "-v") == 0) { diff --git a/common/go/src/asapo_common/version/version_lib.go.in b/common/go/src/asapo_common/version/version_lib.go.in index 2dcfeaeeeccfd566d7bbf1bb69bacead466ab5e1..5fc343fe161f109a008ddad671ee7ba3eabd14d1 100644 --- a/common/go/src/asapo_common/version/version_lib.go.in +++ b/common/go/src/asapo_common/version/version_lib.go.in @@ -3,5 +3,5 @@ package version // Default build-time variable for library-import. // This file is overridden on build with build-time informations. func init(){ - version = "@VERSION@" + version = "@ASAPO_VERSION@@ASAPO_VERSION_COMMIT@" } diff --git a/consumer/api/python/asapo_consumer.pyx.in b/consumer/api/python/asapo_consumer.pyx.in index c26126f2ac5d76086bff9059c6cb211e9ed94d91..2b4978a8050742e9921e2c457b1e6f1ec44cb53e 100644 --- a/consumer/api/python/asapo_consumer.pyx.in +++ b/consumer/api/python/asapo_consumer.pyx.in @@ -290,4 +290,4 @@ def create_server_broker(server_name,source_path,has_filesystem,beamtime_id,stre return factory.create_server_broker(_bytes(server_name),_bytes(source_path),has_filesystem, _bytes(beamtime_id),_bytes(stream),_bytes(token),timeout_ms) -__version__ = "@ASAPO_VERSION_PYTHON@" +__version__ = "@ASAPO_VERSION@@ASAPO_VERSION_COMMIT@" diff --git a/consumer/api/python/binary_dist_windows/setup.py.in b/consumer/api/python/binary_dist_windows/setup.py.in index d2f1e438360b71ff5ef7f694ce5b589a10c99151..f36079e2d70a30c344abb2daa11779230ca9e32a 100644 --- a/consumer/api/python/binary_dist_windows/setup.py.in +++ b/consumer/api/python/binary_dist_windows/setup.py.in @@ -2,7 +2,7 @@ import setuptools setuptools.setup( name ="asapo_consumer", - version = "@ASAPO_VERSION_PYTHON@", + version = "@ASAPO_VERSION@", install_requires=['numpy'], include_package_data=True, packages=['asapo_consumer'], diff --git a/consumer/api/python/source_dist_linux/setup.py.in b/consumer/api/python/source_dist_linux/setup.py.in index 7fc52d9943fafb484f8c082467c709677eca5861..f669a88b0a70c074ef95bb7ca7a20269936b334f 100644 --- a/consumer/api/python/source_dist_linux/setup.py.in +++ b/consumer/api/python/source_dist_linux/setup.py.in @@ -14,7 +14,7 @@ ext_modules = [ setup( name ="asapo_consumer", ext_modules = ext_modules, - version = "@ASAPO_VERSION_PYTHON@", + version = "@ASAPO_VERSION@", setup_requires=["numpy"], install_requires=["numpy"] ) diff --git a/deploy/asapo_helm_chart/asapo/values.yaml b/deploy/asapo_helm_chart/asapo/values.yaml index fb6a5359dd63f4dbc90d82fdeecaf11e52852a40..cfb5e3657d3b5627d0b562d2649f5397da687709 100644 --- a/deploy/asapo_helm_chart/asapo/values.yaml +++ b/deploy/asapo_helm_chart/asapo/values.yaml @@ -57,7 +57,8 @@ common: authSecret: "12ljzgneasfd" offlineDir: "/test_offline" onlineDir: "/test_online" - asapoVersionTag: "feature_ASAPO-108-kubernetes-deployment.latest" + asapoVersionTag: "develop" + asapoRepositoryTag: "-dev" influxdb: authEnabled: false diff --git a/deploy/asapo_services/asap3.tfvars b/deploy/asapo_services/asap3.tfvars index 7ecdf397804d525479303c8f4a85f1ff036fbeee..22b5c25334a8788c705279942108fc92b20e797d 100644 --- a/deploy/asapo_services/asap3.tfvars +++ b/deploy/asapo_services/asap3.tfvars @@ -1,6 +1,6 @@ elk_logs = true -asapo_image_tag = "feature_ASAPO-108-kubernetes-deployment.latest" +asapo_image_tag = "develop" service_dir="/gpfs/asapo/shared/service_dir" online_dir="/beamline" diff --git a/producer/api/python/asapo_producer.pyx.in b/producer/api/python/asapo_producer.pyx.in index 80b43bc3bbc641f88ed3ceb8adf808aef4c64142..7f28a27ec83901b6dc0c6fab9cef933efb69cf5e 100644 --- a/producer/api/python/asapo_producer.pyx.in +++ b/producer/api/python/asapo_producer.pyx.in @@ -314,4 +314,4 @@ def create_producer(endpoint,beamtime_id,beamline,stream,token,nthreads,timeout_ return PyProducer.__create_producer(_bytes(endpoint),_bytes(beamtime_id),_bytes(beamline),_bytes(stream),_bytes(token),nthreads,timeout_sec) -__version__ = "@ASAPO_VERSION_PYTHON@" +__version__ = "@ASAPO_VERSION@@ASAPO_VERSION_COMMIT@" diff --git a/producer/api/python/binary_dist_windows/setup.py.in b/producer/api/python/binary_dist_windows/setup.py.in index 1053f8e942a1c0c314e7ca2b7b9ca884f5925eec..c606b81121a5dd828a0c29253e7d43e2e81b5b72 100644 --- a/producer/api/python/binary_dist_windows/setup.py.in +++ b/producer/api/python/binary_dist_windows/setup.py.in @@ -2,7 +2,7 @@ import setuptools setuptools.setup( name ="asapo_producer", - version = "@ASAPO_VERSION_PYTHON@", + version = "@ASAPO_VERSION@", install_requires=['numpy'], include_package_data=True, packages=['asapo_producer'], diff --git a/producer/api/python/source_dist_linux/setup.py.in b/producer/api/python/source_dist_linux/setup.py.in index 0f7bb563317f7275f6f72acbae17d73265efec68..d1f1987802410e8fdabd7463946d391e13446a89 100644 --- a/producer/api/python/source_dist_linux/setup.py.in +++ b/producer/api/python/source_dist_linux/setup.py.in @@ -14,7 +14,7 @@ ext_modules = [ setup( name ="asapo_producer", ext_modules = ext_modules, - version = "@ASAPO_VERSION_PYTHON@", + version = "@ASAPO_VERSION@", setup_requires=["numpy","cython>=0.28"], install_requires=["numpy","cython>=0.28"] )