From: Robin Wittler Date: Wed, 3 Aug 2011 14:00:10 +0000 (+0200) Subject: add git_buildpackage X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=24651a6ce1f9995357080ae3a5cab9a7878364cd;p=profitbricks%2Fjenkins-build-scripts.git add git_buildpackage --- diff --git a/testgit_build.py b/testgit_build.py index 8a4767d..eaabc38 100755 --- a/testgit_build.py +++ b/testgit_build.py @@ -147,17 +147,22 @@ if __name__ == '__main__': else: logger.info('git clone was not successfull') exit_error() + atexit.register(remove_git_target_workspace) os.chdir(GIT_TARGET_DIR) - #git_helper.git_checkout_branch(GIT_DEBIAN_BRANCH) - git_helper.git_new_branch_from( - GIT_DEBIAN_BRANCH, - os.path.join('origin', GIT_DEBIAN_BRANCH) - ) + + if GIT_UPSTREAM_BRANCH != GIT_DEBIAN_BRANCH: + git_helper.git_new_branch_from( + GIT_DEBIAN_BRANCH, + os.path.join('origin', GIT_DEBIAN_BRANCH) + ) + repo = git.repo.Repo() + + if repo.active_branch != 'master' and GIT_DEBIAN_BRANCH != 'master': + git_helper.git_checkout_branch(GIT_DEBIAN_BRANCH) + if not GIT_COMMITTER_EMAIL: - # if the GIT_COMMIT_EMAIL is not set, - # get the email addi from the commit for commit in repo.commits(): if commit.id == GIT_NEW_ID: GIT_COMMITTER_EMAIL = commit.committer.email @@ -167,7 +172,23 @@ if __name__ == '__main__': ) else: raise Exception('No git_committer_email found') - logger.info('Directory Listing: %s' %(os.listdir(GIT_TARGET_DIR))) + + gbp = git_buildpackage.GitBuildPackage( + upstream_branch=GIT_UPSTREAM_BRANCH, + debian_branch=GIT_DEBIAN_BRANCH, + dist='squeeze', + arch='amd64' + ) + + ret = gbp.build() + logger.debug( + 'This is the return value of git-buildpackage: %s' + %(ret) + ) + +#class GitBuildPackage(object): +# def __init__(self, upstream_branch=None, +# debian_branch=None, dist=None, arch=None) #ftp = FTP( # 'alexandria.profitbricks.localdomain',