curr_commit = gitrepo.commit(remote_branch)
# id attribute used in python-git 0.3.2~RC1-1 found in wheezy
if hasattr(curr_commit, 'hexsha'):
- curr_commit_id = curr_commit.hexsha
+ curr_commit_hexsha = curr_commit.hexsha
# id attribute used in python-git 0.1.6-1 found in squeeze
elif hasattr(curr_commit, 'id'):
- curr_commit_id = curr_commit.id
+ curr_commit_hexsha = curr_commit.id
except Exception as error:
logger.error('Failed to find commit for {input}'.format(input=remote_branch))
exit_error()
tagged_commit_hexsha = tagged_commit.hexsha
else:
tagged_commit_hexsha = tagged_commit.id
- if tagged_commit_hexsha == curr_commit_id:
+ if tagged_commit_hexsha == curr_commit_hexsha:
message = 'Tag {name} was already created for commit {sha}.'.format(
name=remote_tag[0].name,
sha=tagged_commit[0:7],
version=curr_version,
date=daily_date,
build=ENV['BUILD_NUMBER'],
- commit=curr_commit_id[0:7],
+ commit=curr_commit_hexsha[0:7],
suffix=options.version_suffix,
)
pb_suite = 'develop-{dist}'.format(dist=curr_dist)
version=curr_version,
date=daily_date,
build=ENV['BUILD_NUMBER'],
- commit=curr_commit_id[0:7],
+ commit=curr_commit_hexsha[0:7],
suffix=options.version_suffix,
)
reprepro_base = '/srv/dev-{dist}'.format(dist=curr_dist)
#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_id[0:7])
+ # 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_id[0:7])
+ # version = '%s~alpha%s+%s+%s' %(version, daily_date, BUILD_NUMBER,
+ # curr_commit_hexsha[0:7])
# changelog_distro = 'unstable'
# create dput object with data gathered from reprepro_base defined above
'--no-auto-nmu',
'--',
'Generated by Jenkins build of commit {commit}'.format(
- commit=curr_commit_id[0:7],
+ commit=curr_commit_hexsha[0:7],
),
]
dist=curr_dist,
arch='amd64',
pb_suite=pb_suite,
- git_commit_id=curr_commit_id[0:7],
+ git_commit_id=curr_commit_hexsha[0:7],
)
if ret == 0:
logger.info('Current environment:\n\n{env}\n'.format(env=builder.env))