# cleanup existing *orig.tar.gz
if os.path.isdir(BUILD_AREA):
- files = [os.path.join(BUILD_AREA,file) for file in fnmatch.filter(os.listdir(BUILD_AREA),'*.orig.tar.gz')]
+ files = [os.path.join(BUILD_AREA, file)
+ for file in fnmatch.filter(os.listdir(BUILD_AREA), '*.orig.tar.gz')]
+
if len(files) > 0:
logger.debug('Previous upstream tarball(s) found: %s' %( files ))
cmd = [BIN_SUDO, BIN_RM, '-v']
cmd.extend(files)
+ logger.debug('Executing "%s" ...' %(' '.join(cmd)))
cmdobj = subprocess.Popen(
cmd,
shell=False,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
env={'':''}
- )
+ ).wait()
- logger.debug('Calling "%s":' %(' '.join(cmd)))
- ret = cmdobj.wait()
for line in cmdobj.stdout.readlines():
logger.debug('%s' %(line.strip()))
- logger.debug('Cmd returned with status %d' %(cmdobj.returncode))
+
+ logger.debug('Returned with status %d' %(cmdobj.returncode))
# gather details from changelog
cmd = ['dpkg-parsechangelog']
raise Exception(message)
exit_error()
- DPUT_OPTIONS = DPUT_OPTIONS_DEFAULT
-
# get the current commit id
current_commit = git_helper.git_get_commit_id()
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, ENV['BUILD_NUMBER'], current_commit[0:7])
- # these uploads should go to a different repo:
- DPUT_OPTIONS = DPUT_OPTIONS_DEV
else:
#FIXME: enable this once Florian acks.
#if GIT_REPO_PATH.startswith('/srv/git/dev/'):
logger.info('dist: %s' %(pb_suite))
- cmd = ['figlet-figlet', '-t', 'dist: %s' %(pb_suite)]
- subprocess.check_call(cmd)
+ figlet('dist: %s' %(pb_suite))
logger.info('version: %s' %(version))
- cmd = ['figlet-figlet', '-t', 'version: %s' %(version)]
- subprocess.check_call(cmd)
+ figlet('version: %s' %(version))
gbp = git_buildpackage.GitBuildPackage(
upstream_branch=GIT_UPSTREAM_BRANCH,
else:
logger.debug('value of NO_UPLOAD: %s' % NO_UPLOAD)
logger.info('dist: %s' %(pb_suite))
- cmd = ['figlet-figlet', '-t', 'dist: %s' %(pb_suite)]
- subprocess.check_call(cmd)
+ figlet('dist: %s' %(pb_suite))
logger.info('version: %s' %(version))
- cmd = ['figlet-figlet', '-t', 'version: %s' %(version)]
- subprocess.check_call(cmd)
+ figlet('version: %s' %(version))
except Exception, error:
- cmd = ['figlet-figlet', '-t', 'upload to reprepro failed:']
- subprocess.check_call(cmd)
+ figlet('upload to reprepro failed:')
logger.exception(error)
exit_error()
BUILD_END = datetime.datetime.now()
try:
package_instances = add_package_instances("profitbricks", ENV['JOB_NAME'], ENV['BUILD_NUMBER'], changes_file, version, BUILD_START, BUILD_END)
except Exception as error:
- cmd = ['figlet-figlet', '-t', 'CIDB problem:']
- subprocess.check_call(cmd)
+ figlet('CIDB problem:')
logger.error("package instance not added to DB", exc_info=error)
exit_error()
# only trigger liveboots automatically for builds from master+hotfix/* branches
logger.debug("liveboot request failed")
# finally
logger.info('---------------------------------------------------------------------------------------------------------')
- cmd = ['figlet-figlet', '-t', 'Success!!!']
- subprocess.check_call(cmd)
+ figlet('Success!!!')
exit_ok()