]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
let's ignore failures while resetting git clone (thanks holger!)
authorMathias Klette <mathias.klette@profitbricks.com>
Wed, 23 May 2012 13:23:32 +0000 (13:23 +0000)
committerMathias Klette <mathias.klette@profitbricks.com>
Wed, 23 May 2012 13:24:45 +0000 (13:24 +0000)
debian_build.py

index 0fb93f910f8a143a223d7297dfb3ab06a903bbff..bddef527a6144dfc11947b38d8b0a3c518ac74b8 100755 (executable)
@@ -255,22 +255,23 @@ if __name__ == '__main__':
     # reset local repository first
     localname = GIT_BRANCH_NAME
     remotename = os.path.join('origin', GIT_BRANCH_NAME)
-    try:
-        logger.info('Reset and clean repository.')
-        gitcmd = git.Git('.')
-        logger.debug(
-            'git reset --hard HEAD:\n%s'
-            %(gitcmd.reset('--hard','HEAD'))
-        )
-        logger.debug(
-            'git clean -fdx:\n%s'
-            %(gitcmd.clean('-fdx'))
-        )
-        logger.debug(
-            'git branch -D %s\n%s'
-            %(localname,gitcmd.branch('-D','%s' %(localname)))
-        )
 
+    logger.info('Reset and clean repository.')
+    gitcmd = git.Git('.')
+    logger.debug(
+        'git reset --hard HEAD:\n%s'
+        %(gitcmd.reset('--hard','HEAD'))
+    )
+    logger.debug(
+        'git clean -fdx:\n%s'
+        %(gitcmd.clean('-fdx'))
+    )
+    logger.debug(
+        'git branch -D %s\n%s'
+        %(localname,gitcmd.branch('-D','%s' %(localname)))
+    )
+
+    try:
         logger.info('Checkout branch %s.' %(remotename))
         logger.debug(
             'git checkout -b %s %s:\n%s'
@@ -281,7 +282,7 @@ if __name__ == '__main__':
             )
         )
     except Exception, exception:
-        raise Exception('Failure while managing Git clone:\n%s' %(exception))
+        raise Exception('Failure while checking out Git clone:\n%s' %(exception))
     else:
         logger.debug('Status is now:\n%s' %( gitcmd.status() ))