Commit 1bc7059e authored by Siarhei Khaletski (EPAM)'s avatar Siarhei Khaletski (EPAM) 🚩
Browse files

Merge branch 'add-build-id-for-package-ver' into 'master'

Added pipeline iid as a build id for package version

See merge request !37
parents 4246648d 70592944
Pipeline #64322 passed with stages
in 4 minutes and 11 seconds
......@@ -4,6 +4,9 @@ default:
variables:
OSDU_API_LIBS_DIR: $CI_BUILDS_DIR
CLOUD_PROVIDER: provider_test
BUILD_TAG: $CI_COMMIT_TAG
BUILD_COMMIT_SHORT_SHA: $CI_COMMIT_SHORT_SHA
BUILD_ID: $CI_PIPELINE_IID
stages:
- test
......
......@@ -25,7 +25,7 @@ def get_version_from_file():
return fh.read().strip()
def prepare_version():
version = os.getenv("CI_COMMIT_TAG", '')
version = os.getenv("BUILD_TAG", '')
if version.startswith('v'):
# release tag version, e.g. v0.9.0
......@@ -33,8 +33,9 @@ def prepare_version():
else:
# we assume that it is commit version
# https://packaging.python.org/guides/distributing-packages-using-setuptools/#local-version-identifiers
commit = os.environ["CI_COMMIT_SHORT_SHA"]
version = f"{get_version_from_file()}.dev+{commit}"
commit = os.environ["BUILD_COMMIT_SHORT_SHA"]
build_id = os.environ["BUILD_ID"]
version = f"{get_version_from_file()}.dev{build_id}+{commit}"
return version
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment