From 1414366c3401481c27a64894c3637d8933afe6a3 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 20 Sep 2012 17:12:04 +0200 Subject: [PATCH] only update db for master+develop builds --- debian_build.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/debian_build.py b/debian_build.py index 0e412ff..7aac027 100755 --- a/debian_build.py +++ b/debian_build.py @@ -212,9 +212,6 @@ def add_package_instance(origin, job_name, build_number, changes_file, version, db_add_package_instance (con, db_package_id, db_origin_id, db_build_id, version) logger.debug("INSERT success package version %s %s" %( package,version)) #logger.debug('Cmd returned with status %d' %(cmdobj.returncode)) - # FIXME: must not add development builds... or maybe? - # cidb wise, we only care about builds from master - #if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/'): con.commit() logger.info("CIDB update OK.") @@ -689,13 +686,16 @@ if __name__ == '__main__': cmd = ['figlet-figlet', '-t', 'Success!!!'] subprocess.check_call(cmd) BUILD_END = datetime.datetime.now() - try: - add_package_instance("profitbricks", BUILD_JOBNAME, BUILD_NUMBER, changes_file, version, BUILD_START, BUILD_END) - except Exception, error: - cmd = ['figlet-figlet', '-t', 'package instance not added to DB'] - subprocess.check_call(cmd) - #FIXME: this should really cause an error - # exit_error() + # FIXME: must not add development builds... or maybe? + # cidb wise, we only care about builds from master, hotfix + develop + if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME == 'develop' or GIT_BRANCH_NAME.startswith('hotfix/'): + try: + add_package_instance("profitbricks", BUILD_JOBNAME, BUILD_NUMBER, changes_file, version, BUILD_START, BUILD_END) + except Exception, error: + cmd = ['figlet-figlet', '-t', 'package instance not added to DB'] + subprocess.check_call(cmd) + #FIXME: this should really cause an error + # exit_error() # finally exit_ok() -- 2.39.5