]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
kernel repos use default git flow branches names too
authorHolger Levsen <holger@layer-acht.org>
Mon, 19 Sep 2011 19:20:42 +0000 (21:20 +0200)
committerHolger Levsen <holger@layer-acht.org>
Mon, 19 Sep 2011 19:20:42 +0000 (21:20 +0200)
kernel_inpbuilder.py

index b1c8350d1438a3b093811d16fef4111a99a9cfd1..2774d36b5284a7b1aa6c9aeb323e78aedd5b755a 100644 (file)
@@ -253,24 +253,13 @@ def create_file(path,data):
         raise
 
 def determine_kernel_flavour():
-    # don't put the branch names into the packages names
-    # instead just use the flavour part:
-    if GIT_BRANCH_NAME.startswith('master-'):
-        flavour = GIT_BRANCH_NAME[7:]
-    elif GIT_BRANCH_NAME.startswith('develop-'):
-        flavour = GIT_BRANCH_NAME[8:]
-    elif GIT_BRANCH_NAME.startswith('release-'):
-        flavour = GIT_BRANCH_NAME[8:]
-    elif GIT_BRANCH_NAME.startswith('hotfix-'):
-        flavour = GIT_BRANCH_NAME[7:]
-    else: 
-        logger.error('GIT_BRANCH_NAME is %s, flavour is none.' % GIT_BRANCH_NAME)
-        flavour = 'none'
+    flavour = GIT_REPO_NAME[6:]
 
     # slightly different version numbers per branch
-    if flavour in ('master', 'hotfix'):
+    if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix'):
+        # FIXME: not -build...
         debian_version = '$(version)-build%s' % REVISION
-    elif flavour == 'release':
+    elif GIT_BRANCH_NAME.startswith('release'):
         debian_version = '$(version)~rc%s' % REVISION
     else:
         debian_version = '$(version)~develop%s' % REVISION
@@ -424,9 +413,9 @@ if __name__ == '__main__':
 
         logger.info('FTP Login on %s successful' %(ftp.host))
 
-        if GIT_BRANCH_NAME.startswith('master-') or GIT_BRANCH_NAME.startswith('hotfix-'):
+        if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/'):
             ftp.cwd('production-proposed-updates')
-        elif GIT_BRANCH_NAME.startswith('release-'):
+        elif GIT_BRANCH_NAME.startswith('release/'):
             ftp.cwd('staging');
         else:
             ftp.cwd('pre-staging');