]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
debian_build: handle integration branch of vdc-bundles
authorMathias Klette <mathias.klette@profitbricks.com>
Tue, 21 May 2013 08:01:44 +0000 (10:01 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Tue, 21 May 2013 08:01:44 +0000 (10:01 +0200)
debian_build.py

index c63fa75df2c835b025244277b33cd580718a4665..05822df570672594c6730634a7b2d55f0fc5d775 100755 (executable)
@@ -219,6 +219,13 @@ if __name__ == '__main__':
         dput_obj.contents.update({
             'post_upload_command': 'ssh reprepro@alexandria.pb.local /srv/dev-repository/bin/pb_processincoming',
             })
+
+        # branch integration of vdc-bundles requires "stable"-tags for continues integration,
+        # merges to develop will be done from such tags manually
+        if ENV['GIT_BRANCH'] == 'integration':
+            new_tag = 'stable_' + ENV['BUILD_NUMBER']
+            do_tagging = True
+
         if ENV['DISTRIBUTION'] == 'squeeze':
             dput_obj.contents.update({
                 'incoming': '/srv/dev-repository/incoming/',
@@ -409,8 +416,12 @@ if __name__ == '__main__':
     else:
         try:
             if os.path.exists(reports_file):
-                subprocess.check_call(['/bin/tar', 'xzvf', '-C', ENV['WORKSPACE'], reports_file])
-                subprocess.check_call(['/usr/bin/sudo' , '/bin/rm', '-v', reports_file])
+                for cmd in (['/bin/tar', 'xzvf', reports_file, '-C', ENV['WORKSPACE']],
+                            ['/usr/bin/sudo' , '/bin/rm', '-v', reports_file]):
+                    if not subprocess.check_call(cmd):
+                        logger.warn(cmd + ' failed.')
+                    else:
+                        logger.info(cmd + ' succeeded.')
             else:
                 logger.info('No reports found.')
             figlet('Reports OK')
@@ -422,20 +433,20 @@ if __name__ == '__main__':
         figlet('Tagging skipped')
     else:
         try:
-            gitrepo.git.tag(version_tag)
+            gitrepo.git.tag(new_tag)
         except Exception as error:
             logger.error('Could not create tag: ', exc_info=error)
             figlet('Tagging failed')
             exit_error()
 
         try:
-            gitrepo.git.push('origin', version_tag)
+            gitrepo.git.push('origin', new_tag)
         except Exception as error:
             logger.error('Could not push tag: ', exc_info=error)
             figlet('Tagging failed')
             exit_error()
 
-        logger.info('Tagged as "%s".' % version_tag)
+        logger.info('Tagged as "%s".' % new_tag)
         figlet('Tagging OK')
 
     # .. and upload