]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
add more documentation and correct order
authorMathias Klette <mathias.klette@profitbricks.com>
Thu, 29 Sep 2011 10:30:09 +0000 (12:30 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Thu, 29 Sep 2011 10:30:09 +0000 (12:30 +0200)
when checkout of our UPSTREAM branch is done, after we have cleaned up
tree, we would checkout the wrong branch again

debian_build.py

index 2495665df424d7c9b96bdb5716e663d1f1f91db8..cda6e2324db08bb5ac5eb8fb10ecac24bd09ae8b 100755 (executable)
@@ -297,13 +297,23 @@ if __name__ == '__main__':
                 os.path.join('origin', GIT_DEBIAN_BRANCH)
         )
 
-    # git-buildpackage uses only treeish object in v0.5.10,
-    # let's fetch it correctly
+    # git-buildpackage uses only treeish object in v0.5.10, so let's fetch the 
+    # treeish refspec when a name was given (i.e. tag names, branch names, 
+    # etc.)
     # TODO: upgrade git-buildpackage
     GIT_UPSTREAM_BRANCH = git_helper.git_get_treeish(
         os.path.join('origin', GIT_UPSTREAM_BRANCH)
     )
 
+    # now checkout the requested branch
+    if git_helper.git_checkout_branch(GIT_UPSTREAM_BRANCH):
+        logger.info('git checkout %s was successfull' % GIT_UPSTREAM_BRANCH)
+    else:
+        logger_loud_error('git checkout %s was not successfull' % GIT_UPSTREAM_BRANCH)
+        exit_error()
+
+    # we need to make sure our jenkins config is used, so let's delete any 
+    # other config available in repository that might be prefered 
     cleanup_files = ('.gbp.conf', 'debian/gbp.conf', '.git/gbp.conf')
     result = git_helper.git_cleanup_branch(cleanup_files)
     commit_files = result["goods"].keys()
@@ -313,13 +323,6 @@ if __name__ == '__main__':
             commit_files
         )
 
-
-    if git_helper.git_checkout_branch(GIT_UPSTREAM_BRANCH):
-        logger.info('git checkout %s was successfull' % GIT_UPSTREAM_BRANCH)
-    else:
-        logger_loud_error('git checkout %s was not successfull' % GIT_UPSTREAM_BRANCH)
-        exit_error()
-
     cmd = ['dpkg-parsechangelog']
     parse_changelog =  subprocess.Popen(
             cmd,