From: Holger Levsen Date: Thu, 3 Nov 2011 19:05:16 +0000 (+0100) Subject: also add commit id to changelog for production-p-u builds X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=4a6a976bfff6d5dcf5a9dda56f6e547aaaae1093;p=profitbricks%2Fjenkins-build-scripts.git also add commit id to changelog for production-p-u builds --- diff --git a/debian_build.py b/debian_build.py index 9abbcbd..30f1e8b 100755 --- a/debian_build.py +++ b/debian_build.py @@ -17,6 +17,7 @@ import platform import subprocess import time import urllib +import fileinput from glob import glob from ftplib import FTP from lib import git_helper @@ -422,14 +423,21 @@ if __name__ == '__main__': raise Exception( '"%s" returned with exitcode: %s' %(' '.join(cmd), ret) ) - - # we need to commit here else git-buildpackage will use the existing debian/changelog... - # TODO: Later we should investigate why the "--ignore-new" trick - # did not work! - cmd = ['/usr/bin/git', 'add', '-A'] - subprocess.check_call(cmd) - cmd = ['/usr/bin/git', 'commit', '-a', '-m', 'add new changelog entry'] - subprocess.check_call(cmd) + else: + line_counter = 0 + for line in fileinput.input('debian/changelog', inplace=1): + line_counter += 1 + if line_counter == 3: + print ' * Generated by jenkins build of %s' % git_helper.git_get_commit_id() + print line + + # we need to commit here else git-buildpackage will use the existing debian/changelog... + # TODO: Later we should investigate why the "--ignore-new" trick + # did not work! + cmd = ['/usr/bin/git', 'add', '-A'] + subprocess.check_call(cmd) + cmd = ['/usr/bin/git', 'commit', '-a', '-m', 'add new changelog entry'] + subprocess.check_call(cmd) if not GIT_COMMITTER_EMAIL: for commit in repo.commits():