]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
debian_build: take over changes from sagunt
authorMathias Klette <mathias.klette@profitbricks.com>
Mon, 17 Jun 2013 08:56:54 +0000 (10:56 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Mon, 17 Jun 2013 08:56:54 +0000 (10:56 +0200)
debian_build.py

index 9c085f7317971afb5204d5baa6417ccccddb6aa0..424f911ee931316eff4980e226314203d41cea43 100755 (executable)
@@ -41,10 +41,10 @@ ENV.setdefault('BUILD_TRIGGERS', '')
 BUILD_START = datetime.datetime.now()
 
 AUTO_CHANGELOG_REPONAMES = (
-    'infrastructure-docs',
     'ri-docs',
-    'sl',
     'so-docs',
+    'infrastructure-docs',
+    'sl',
     'storage-docs',
 )
 STABLE_DISTRIBUTIONS = (
@@ -129,6 +129,8 @@ if __name__ == '__main__':
         gitrepo.name = gitrepo.remotes['origin']['fetch'].split('/')[-1].strip('.git')
     else:
         gitrepo.name = gitrepo.remotes.origin.url.split('/')[-1].strip('.git')
+    logger.info('Remotes: %s' % gitrepo.remotes)
+    logger.info('Repository Name: %s' % gitrepo.name)
 
     # .. some local variables
     daily_date = BUILD_START.strftime('%Y%m%d%H%M%S')
@@ -355,6 +357,8 @@ if __name__ == '__main__':
                 logger.error('Rebase has failed!\n\n%s\n' % error.stderr, exc_info=error)
                 logger.debug(gitrepo.git.rebase('--abort'))
                 logger.debug(gitrepo.git.reset('--hard',src_branch))
+                if os.path.exists('.git/rebase-apply'):
+                    subprocess.check_call(['rm','-rf','.git/rebase-apply'])
                 exit_error()
 
         if 'no-test' in build_triggers:
@@ -374,13 +378,13 @@ if __name__ == '__main__':
     if do_autoincrement:
         logger.info('This is an autoincrementing project.')
         try:
-            logger.debug(subprocess.check_call([BIN_DCH, '-i', 'Released by enkins.']))
-            logger.debug(subprocess.check_call([BIN_GIT_DCH, '-R', '-a', --spawn-editor=none']))
-            logger.debug(gitrepo.git.commit('-a', '-s', '-m', 'Released by enkins'))
+            logger.debug(subprocess.check_call([BIN_DCH, '-i', 'Released by jenkins.']))
+            logger.debug(subprocess.check_call([BIN_GIT_DCH, '-R', '-a', '--spawn-editor=none']))
+            logger.debug(gitrepo.git.commit('-a', '-s', '-m', 'Released by jenkins'))
             logger.debug(gitrepo.git.push('origin', 'master'))
-            logger.info('Changelog autoincremented and pushed back by enkins!')
+            logger.info('Changelog autoincremented and pushed back by Jenkins!')
         except Exception as error:
-            logger.error('Autoincrement failed. Standard error eturned:\n\n%s\n' % error.stderr, exc_info=error)
+            logger.error('Autoincrement failed. Standard error returned:\n\n%s\n' % error.stderr, exc_info=error)
             exit_error()
 
     # .. or set approriate versions for our development candidates
@@ -469,12 +473,12 @@ if __name__ == '__main__':
         figlet('Build OK')
 
     logger.info('''
-### 
+###
 ###  In case you need to analyze the results within chroot, do the following:
 ###    * login to {hostname}
 ###    * become user {jenkins_user}
 ###    * then execute:
-### 
+###
 
 cd {jenkins_workspace}
 export {gbp_env} FORCE_SHELL=TRUE
@@ -486,7 +490,7 @@ export {gbp_env} FORCE_SHELL=TRUE
             hostname=socket.gethostname(),
             jenkins_user=ENV['USER'],
             jenkins_workspace=ENV['WORKSPACE'],
-            gbp_env=' '.join(['{k}="{v}"'.format(k=key, v=gbp.env[key],) 
+            gbp_env=' '.join(['{k}="{v}"'.format(k=key, v=gbp.env[key],)
                               for key in gbp.env.keys()
                             ]),
             command=' '.join(gbp.command),