]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
include BUILD_NUMBER and git commit id in development version numbers
authorHolger Levsen <holger@layer-acht.org>
Fri, 27 Jan 2012 15:08:02 +0000 (16:08 +0100)
committerHolger Levsen <holger@layer-acht.org>
Fri, 27 Jan 2012 15:08:02 +0000 (16:08 +0100)
debian_build.py

index a995833d2bc3c76411561257ee0d73795dc276e9..211d143adf6cd2ecefbb793967e1e02469f44c27 100755 (executable)
@@ -350,18 +350,20 @@ if __name__ == '__main__':
     DPUT_OPTIONS = DPUT_OPTIONS_DEFAULT
 
     if options.distribution in ('testing', 'staging', 'unstable', 'pre-staging','experimental') or GIT_BRANCH_NAME.startswith('release/') or GIT_BRANCH_NAME.startswith('hotfix/'):
-        daily_date = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
+        daily_date = datetime.datetime.now().strftime('%Y%m%d')
+
+       current_commit = git_helper.git_get_commit_id()
 
         if GIT_BRANCH_NAME.startswith('release/') or GIT_BRANCH_NAME.startswith('hotfix/'):
-            version = '%s~rc%s' %(version, daily_date)
+            version = '%s~rc%s+%s+%s' %(version, daily_date, BUILD_NUMBER, current_commit)
         elif GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/')  or options.distribution == 'experimental':
-            version = '%s~alpha%s' %(version, daily_date)
+            version = '%s~experimental%s+%s+%s' %(version, daily_date, BUILD_NUMBER, current_commit)
             # these uploads should go to a different repo:
             DPUT_OPTIONS = DPUT_OPTIONS_DEV
         else:
-            version = '%s~develop%s' %(version, daily_date)
+            version = '%s~develop%s+%s+%s' %(version, daily_date, BUILD_NUMBER, current_commit)
 
-        new_log = 'Generated by jenkins build of %s' % git_helper.git_get_commit_id()
+        new_log = 'Generated by jenkins build of %s' % current_commit
 
         if GIT_BRANCH_NAME == 'experimental' or GIT_BRANCH_NAME.startswith('feature/') or GIT_BRANCH_NAME.startswith('poc/') or GIT_BRANCH_NAME.startswith('bugfix/'):
             changelog_distro ='dev-'+ GIT_BRANCH_NAME.replace("/","-")