ENV.setdefault('NO_UPLOAD','')
NO_UPLOAD = ENV['NO_UPLOAD']
+BUILD_START = datetime.datetime.now()
+
#unused: (except in in-active code)
GIT_TARGET_WORKSPACE = os.path.join(
CWD,
- ('%s-build%s' %(BUILD_ID, BUILD_NUMBER)),
+ ('%s-build%s' %(ENV['BUILD_ID'], ENV['BUILD_NUMBER'])),
)
#unused: (except in in-active code)
GIT_TARGET_DIR = os.path.join(
else:
logger.debug('Status is now:\n%s' %( gitcmd.status().strip() ))
- if GIT_BRANCH_NAME == 'master' and BUILD_JOBNAME in AUTO_CHANGELOG_JOBS:
+ if GIT_BRANCH_NAME == 'master' and ENV['BUILD_JOBNAME'] in AUTO_CHANGELOG_JOBS:
cmd = ['/usr/bin/dch', '-i', 'Released by jenkins.']
subprocess.check_call(cmd)
cmd = ['/usr/bin/git-dch', '-R', '-a', '--spawn-editor=none']
changelog_distro = 'staging'
# use shorter date because we can
daily_date = datetime.datetime.now().strftime('%Y%m%d')
- version = '%s~rc%s+%s+%s' %(version, daily_date, BUILD_NUMBER, current_commit[0:7])
+ version = '%s~rc%s+%s+%s' %(version, daily_date, ENV['BUILD_NUMBER'], current_commit[0:7])
elif GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/'):
changelog_distro ='dev-'+ GIT_BRANCH_NAME.replace("/","-")
- version = '%s~experimental%s+%s+%s' %(version, daily_date, BUILD_NUMBER, current_commit[0:7])
+ version = '%s~experimental%s+%s+%s' %(version, daily_date, ENV['BUILD_NUMBER'], current_commit[0:7])
# these uploads should go to a different repo:
DPUT_OPTIONS = DPUT_OPTIONS_DEV
else:
# version = '%s~alpha%s+%s+%s' %(version, daily_date, BUILD_NUMBER, current_commit[0:7])
# changelog_distro = 'unstable'
#else:
- version = '%s~develop%s+%s+%s' %(version, daily_date, BUILD_NUMBER, current_commit[0:7])
+ version = '%s~develop%s+%s+%s' %(version, daily_date, ENV['BUILD_NUMBER'], current_commit[0:7])
changelog_distro = 'pre-staging'
new_log = 'Generated by jenkins build of %s' % current_commit
package_instances=[]
if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME == 'develop' or GIT_BRANCH_NAME.startswith('hotfix/'):
try:
- package_instances = add_package_instances("profitbricks", BUILD_JOBNAME, BUILD_NUMBER, changes_file, version, BUILD_START, BUILD_END)
+ package_instances = add_package_instances("profitbricks", ENV['BUILD_JOBNAME'], ENV['BUILD_NUMBER'], changes_file, version, BUILD_START, BUILD_END)
except Exception, error:
cmd = ['figlet-figlet', '-t', 'CIDB problem:']
subprocess.check_call(cmd)