]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
add support for uploading builds from feature etc branches to another repo
authorHolger Levsen <holger@layer-acht.org>
Tue, 24 Jan 2012 16:44:24 +0000 (17:44 +0100)
committerHolger Levsen <holger@layer-acht.org>
Tue, 24 Jan 2012 16:44:24 +0000 (17:44 +0100)
debian_build.py

index ac0993e31ce1dcaba502474585139059e385164a..409dbf81a53409277e1400c572ba39c82220a88c 100755 (executable)
@@ -64,7 +64,7 @@ GIT_TARGET_DIR = os.path.join(
 JOB_NAME = os.environ.get('JOB_NAME')
 GIT_COMMITTER_EMAIL = os.environ.get('GIT_COMMITTER_EMAIL')
 
-DPUT_OPTIONS = {
+DPUT_OPTIONS_DEFAULT = {
         'fqdn': 'alexandria.profitbricks.localdomain',
         'method': 'scp',
         'login': 'reprepro',
@@ -72,6 +72,14 @@ DPUT_OPTIONS = {
         'allow_unsigned_uploads': 1,
         'post_upload_command': 'ssh reprepro@alexandria.profitbricks.localdomain /srv/profitbricks-repository/bin/pb_processincoming',
         }
+DPUT_OPTIONS_DEV = {
+        'fqdn': 'alexandria.profitbricks.localdomain',
+        'method': 'scp',
+        'login': 'reprepro',
+        'incoming': '/srv/profitbricks-dev-repository/incoming/profitbricks',
+        'allow_unsigned_uploads': 1,
+        'post_upload_command': 'ssh reprepro@alexandria.profitbricks.localdomain /srv/profitbricks-dev-repository/bin/pb_processincoming',
+        }
 DPUT_CF = os.path.join(GIT_TARGET_WORKSPACE, 'dput.cf')
 
 NO_UPLOAD = os.environ.get('NO_UPLOAD')
@@ -339,13 +347,17 @@ if __name__ == '__main__':
         )
         exit_error()
 
-    if options.distribution in ('testing', 'staging', 'unstable', 'pre-staging','experimental') or GIT_BRANCH_NAME.startswith('release') or GIT_BRANCH_NAME.startswith('hotfix'):
+    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')
 
-        if GIT_BRANCH_NAME.startswith('release') or GIT_BRANCH_NAME.startswith('hotfix'):
+        if GIT_BRANCH_NAME.startswith('release/') or GIT_BRANCH_NAME.startswith('hotfix/'):
             version = '%s~rc%s' %(version, daily_date)
-        elif options.distribution.startswith('feature') or options.distribution == 'experimental':
+        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)
+            # these uploads should go to a different repo:
+            DPUT_OPTIONS = DPUT_OPTIONS_DEV
         else:
             version = '%s~develop%s' %(version, daily_date)
 
@@ -402,7 +414,7 @@ if __name__ == '__main__':
       pb_suite='experimental'
     elif options.distribution in ('unstable' , 'pre-staging'):
       pb_suite='pre-staging'
-    elif GIT_BRANCH_NAME.startswith('release') or GIT_BRANCH_NAME.startswith('hotfix') or options.distribution in ('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates'):
+    elif GIT_BRANCH_NAME.startswith('release/') or GIT_BRANCH_NAME.startswith('hotfix/') or options.distribution in ('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates'):
       pb_suite='production-proposed-updates'
        
     gbp = git_buildpackage.GitBuildPackage(