From: Mathias Klette Date: Wed, 29 May 2013 12:11:23 +0000 (+0200) Subject: common_code: reset GIT_BRANCH if it differs from GIT_BRANCH_NAME X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=908ff63f16e0b48250e21ba392bb35724cc66cdf;p=profitbricks%2Fjenkins-build-scripts.git common_code: reset GIT_BRANCH if it differs from GIT_BRANCH_NAME Most jobs use GIT_BRANCH_NAME parameter to let user choose the branch to build the package from while GIT_BRANCH contains the sha commit id of HEAD of most recent commit (unconfirmed yet). --- diff --git a/common_code.py b/common_code.py index f2ad5d8..2b01ffc 100755 --- a/common_code.py +++ b/common_code.py @@ -49,6 +49,8 @@ ENV = os.environ ENV.setdefault('ARGV',' '.join(sys.argv)) ENV.setdefault('CWD',os.getcwd()) ENV.setdefault('GIT_BRANCH_NAME', ENV['GIT_BRANCH']) +if ENV['GIT_BRANCH'] != ENV['GIT_BRANCH_NAME']: + ENV['GIT_BRANCH'] = ENV['GIT_BRANCH_NAME'] BIN_DCH = '/usr/bin/dch' BIN_DPUT = '/usr/bin/dput'