daily_date = BUILD_START.strftime('%Y%m%d%H%M%S')
# .. repository related
- curr_commit = ENV['GIT_COMMIT']
gitrepo = git.Repo('.')
+ curr_commit = gitrepo.commit(ENV['GIT_COMMIT'])
local_branch = re.match('^(origin/)?(.*)',ENV['GIT_BRANCH']).groups()[1]
remote_branch = os.path.join('origin', local_branch)
reports_file = os.path.join(ENV['WORKSPACE'], '../build-area/result/reports.tgz',)
# except, the existing tag uses the same commit as we were triggered with
remote_tag = [tag for tag in gitrepo.tags if tag.name == new_tag]
if len(remote_tag) > 0:
- if remote_tag[0].commit.id == curr_commit:
+ if remote_tag[0].commit.id == curr_commit.hexsha:
logger.debug('Tag was already created for this commit.')
do_tagging = False
else:
version = curr_version,
date = daily_date,
build = ENV['BUILD_NUMBER'],
- commit = curr_commit[0:7],
+ commit = curr_commit.hexsha[0:7],
)
pb_suite = 'experimental-' + ENV['DISTRIBUTION']
dput_obj.contents.update({
#FIXME: get rid of jenkins parameter, instead use git remote
#if GIT_REPO_PATH.startswith('/srv/git/dev/'):
# if ENV['GIT_BRANCH_NAME'] == 'pre-staging':
- # version = '%s~develop%s+%s+%s' %(version, daily_date, BUILD_NUMBER, curr_commit[0:7])
+ # version = '%s~develop%s+%s+%s' %(version, daily_date, BUILD_NUMBER, curr_commit.hexsha[0:7])
# changelog_distro = 'pre-staging'
# else:
# # use shorter date because we can
# daily_date = datetime.datetime.now().strftime('%Y%m%d')
- # version = '%s~alpha%s+%s+%s' %(version, daily_date, BUILD_NUMBER, curr_commit[0:7])
+ # version = '%s~alpha%s+%s+%s' %(version, daily_date, BUILD_NUMBER, curr_commit.hexsha[0:7])
# changelog_distro = 'unstable'
logger.debug('Distribution: "%s" => "%s"' %(curr_dist,new_dist))
'--no-auto-nmu',
'--',
'Generated by Jenkins build of commit {commit}'.format(
- commit = curr_commit[0:7]
+ commit = curr_commit.hexsha[0:7]
),
]
dist = ENV['DISTRIBUTION'],
arch = 'amd64',
pb_suite = pb_suite,
- git_commit_id = curr_commit[0:7]
+ git_commit_id = curr_commit.hexsha[0:7]
)
ret = gbp.build()