Commit 08318fec authored by Markus Frosch's avatar Markus Frosch
Browse files

upload: Add support for ICINGA_BUILD_RELEASE_TYPE

parent 3e325c11
Pipeline #4247 passed with stage
in 17 seconds
......@@ -16,6 +16,7 @@ APTLY_SESSION = None
CI_JOB_NAME = 'CI_JOB_NAME'
CI_JOB_UPLOAD_PREFIX = 'upload[:/]'
ICINGA_BUILD_TYPE = 'ICINGA_BUILD_TYPE'
ICINGA_BUILD_RELEASE_TYPE = 'ICINGA_BUILD_RELEASE_TYPE'
ICINGA_BUILD_TYPE_DEFAULT = 'release'
UPLOAD_TYPE_DEB = 'DEB'
......@@ -90,11 +91,17 @@ def ci_split_name():
return None
def get_build_type():
def get_release_type():
"""
Get ICINGA_BUILD_TYPE from environ
Get ICINGA_BUILD_RELEASE_TYPE or ICINGA_BUILD_TYPE from environ
"""
return os.environ.get(ICINGA_BUILD_TYPE, ICINGA_BUILD_TYPE_DEFAULT)
if os.environ.has_key(ICINGA_BUILD_RELEASE_TYPE):
return os.environ.get(ICINGA_BUILD_RELEASE_TYPE)
if os.environ.has_key(ICINGA_BUILD_TYPE):
return os.environ.get(ICINGA_BUILD_TYPE)
return ICINGA_BUILD_TYPE_DEFAULT
def ci_release(upload_type, release):
"""
......@@ -108,7 +115,7 @@ def ci_release(upload_type, release):
RPM / 7 / release -> 7/release
RPM / X / Y -> X/Y
"""
build_type = get_build_type()
build_type = get_release_type()
if upload_type == UPLOAD_TYPE_DEB:
publish_release = 'icinga-' + release
......@@ -135,7 +142,7 @@ def ci_repo(upload_type, target, release):
if upload_type != UPLOAD_TYPE_DEB:
raise StandardError, "Repo can only be set on DEB uploads!"
build_type = get_build_type()
build_type = get_release_type()
return 'icinga-%s-%s-%s' % (target, release, build_type)
......
Supports Markdown
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