From: Holger Levsen Date: Thu, 20 Sep 2012 15:12:04 +0000 (+0200) Subject: only update db for master+develop builds X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=1414366c3401481c27a64894c3637d8933afe6a3;p=profitbricks%2Fjenkins-build-scripts.git only update db for master+develop builds --- 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()