]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
only update db for master+develop builds
authorHolger Levsen <holger@layer-acht.org>
Thu, 20 Sep 2012 15:12:04 +0000 (17:12 +0200)
committerHolger Levsen <holger@layer-acht.org>
Thu, 20 Sep 2012 15:12:04 +0000 (17:12 +0200)
debian_build.py

index 0e412ffdd424143aa0ca01feff106960f7ef9f66..7aac0272750925c3bb4109a751accee4fa9f22ce 100755 (executable)
@@ -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()