except psycopg2.DatabaseError as e:
# record already exist - this MUST NOT HAPPEN for jenkins builds
cur.execute("ROLLBACK TO a") # have to rollback after failed command
- logger_error("FAILED: INSERT INTO deb_package_instance(deb_package_id, deb_package_origin_id, jenkins_build_result_id, version, available) VALUES(%s, %s, %s, '%s', 'true') RETURNING id" % (package_id, origin_id, build_result_id, version))
+ logger.error("FAILED: INSERT INTO deb_package_instance(deb_package_id, deb_package_origin_id, jenkins_build_result_id, version, available) VALUES(%s, %s, %s, '%s', 'true') RETURNING id" % (package_id, origin_id, build_result_id, version))
exit_error()
return cur.fetchone()[0]
#if git_helper.git_clone_remote_repository(GIT_REPO_PATH, GIT_TARGET_DIR):
# logger.info('git clone was successfull')
#else:
- # logger_error('git clone was not successfull')
+ # logger.error('git clone was not successfull')
# exit_error()
#atexit.register(remove_git_target_workspace)
GIT_UPSTREAM_BRANCH
)
else:
- logger_error('Could not determine GIT_UPSTREAM_BRANCH')
+ logger.error('Could not determine GIT_UPSTREAM_BRANCH')
exit_error()
repo = git.repo.Repo()
)
ret = parse_changelog.wait()
if ret:
- logger_error('%s was not successfull, return code was %s ' % (' '.join(cmd), ret))
+ logger.error('%s was not successfull, return code was %s ' % (' '.join(cmd), ret))
raise Exception(
'%s was not successfull, return code was %s ' % (' '.join(cmd), ret)
)
)
ret = grep_dctrl.wait()
if ret:
- logger_error('%s was not successfull, return code was %s ' % (' '.join(cmd), ret))
+ logger.error('%s was not successfull, return code was %s ' % (' '.join(cmd), ret))
raise Exception(
'%s was not successfull, return code was %s ' % (' '.join(cmd), ret)
)
section = section.strip()
logger.info('Package section is %s' % (section))
if section == 'unknown':
- logger_error('debian/control sets "section" to unknown. This is not allowed, failing...')
+ logger.error('debian/control sets "section" to unknown. This is not allowed, failing...')
raise Exception('debian/control sets "section" to unknown. This is not allowed, failing...')
exit_error()
# enforce correct distribution in debian/changelog for master and hotfix branches
allowed_production_distros=('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates')
if (GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/')) and not distribution in allowed_production_distros:
- logger_error('Distribution %s in debian/changelog not listed in %s' % allowed_production_distros )
+ logger.error('Distribution %s in debian/changelog not listed in %s' % allowed_production_distros )
raise Exception(
'Distribution %s in debian/changelog not listed in %s' % allowed_production_distros
subprocess.check_call(cmd)
# now handle gpb result
if ret:
- logger_error(
+ logger.error(
'git-buildpackage returned non-zero. exitcode was: %s' % ret
)
exit_error()
try:
subprocess.check_call(cmd)
except:
- logger_error('Could not tag repository with "%s".' % version_tag)
+ logger.error('Could not tag repository with "%s".' % version_tag)
exit_error()
cmd = ['/usr/bin/git', 'push', 'origin', version_tag]
try:
subprocess.check_call(cmd)
except:
- logger_error('Could not push tag "%s" to repository.' % version_tag)
+ logger.error('Could not push tag "%s" to repository.' % version_tag)
exit_error()
logger.info('Tagged as "%s".' % version_tag)
subprocess.check_call(cmd)
logger.exception(error)
exit_error()
- logger.info('---------------------------------------------------------------------------------------------------------')
- cmd = ['figlet-figlet', '-t', 'Success!!!']
- subprocess.check_call(cmd)
BUILD_END = datetime.datetime.now()
# FIXME: must not add development builds... or maybe?
# cidb wise, we only care about builds from master, hotfix + develop
except Exception, error:
cmd = ['figlet-figlet', '-t', 'CIDB problem:']
subprocess.check_call(cmd)
- logger_error("package instance not added to DB")
+ logger.error("package instance not added to DB")
exit_error()
if len(package_instances) > 0:
try:
except:
logger.debug("liveboot request failed")
# finally
+ logger.info('---------------------------------------------------------------------------------------------------------')
+ cmd = ['figlet-figlet', '-t', 'Success!!!']
+ subprocess.check_call(cmd)
exit_ok()