]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
release branches should trigger p-p-u builds
authorHolger Levsen <holger@layer-acht.org>
Tue, 13 Mar 2012 14:24:58 +0000 (15:24 +0100)
committerHolger Levsen <holger@layer-acht.org>
Tue, 13 Mar 2012 14:24:58 +0000 (15:24 +0100)
debian_build.py

index 817c9f6e61fdf09f84a4049dea919db2b87cd581..54d6b19de34111d8496b1f9e026985f7ff885033 100755 (executable)
@@ -327,9 +327,11 @@ if __name__ == '__main__':
     # get the current commit id
     current_commit = git_helper.git_get_commit_id()
 
-    if options.distribution in ('testing', 'staging', 'unstable', 'pre-staging','experimental') or GIT_BRANCH_NAME.startswith('release/'):
+    # FIXME: we should really only test for branch names here, not for distros
+    if options.distribution in ('testing', 'staging', 'unstable', 'pre-staging','experimental'):
         daily_date = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
-
+        if GIT_BRANCH_NAME.startswith('release/'):
+            daily_date = datetime.datetime.now().strftime('%Y%m%d')
 
         if GIT_BRANCH_NAME.startswith('release/'):
             version = '%s~rc%s+%s+%s' %(version, daily_date, BUILD_NUMBER, current_commit[0:7])
@@ -388,8 +390,7 @@ if __name__ == '__main__':
           print line
 
     # we need to commit here else git-buildpackage will use the existing debian/changelog...
-    # TODO: Later we should investigate why the "--ignore-new" trick
-    # did not work!
+    # TODO: Later we should investigate why "--ignore-new" does not work!
     cmd = ['/usr/bin/git', 'add', '-A']
     subprocess.check_call(cmd)
     cmd = ['/usr/bin/git', 'commit', '-a', '-m', 'add new changelog entry']
@@ -397,10 +398,10 @@ if __name__ == '__main__':
 
     if GIT_BRANCH_NAME == 'experimental' or GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/'):
       pb_suite=changelog_distro
-    elif GIT_BRANCH_NAME.startswith('release/') or options.distribution in ('unstable' , 'pre-staging'):
-      pb_suite='pre-staging'
-    elif GIT_BRANCH_NAME.startswith('hotfix/') or options.distribution in ('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates'):
+    elif GIT_BRANCH_NAME.startswith('hotfix/') or GIT_BRANCH_NAME.startswith('release/') or options.distribution in ('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates'):
       pb_suite='production-proposed-updates'
+    elif options.distribution in ('unstable' , 'pre-staging'):
+      pb_suite='pre-staging'
        
     logger.info('dist: %s' %(pb_suite))
     cmd = ['figlet-figlet', '-t', 'dist: %s' %(pb_suite)]