Start recording the commit sha and other metadata about github triggered builds. We'll eventually show this information in the UI

This commit is contained in:
Joseph Schorr 2015-02-18 14:12:59 -05:00
parent 4cf18c4591
commit 7c81d90cda
5 changed files with 22 additions and 9 deletions

View file

@ -345,8 +345,10 @@ class GithubBuildTrigger(BuildTrigger):
# compute the tag(s)
branch = ref.split('/')[-1]
tags = {branch}
if branch == repo.default_branch:
tags.add('latest')
logger.debug('Pushing to tags: %s' % tags)
# compute the subdir
@ -354,7 +356,14 @@ class GithubBuildTrigger(BuildTrigger):
joined_subdir = os.path.join(tarball_subdir, repo_subdir)
logger.debug('Final subdir: %s' % joined_subdir)
return dockerfile_id, list(tags), build_name, joined_subdir
# compute the metadata
metadata = {
'commit_sha': commit_sha,
'ref': ref,
'default_branch': repo.default_branch
}
return dockerfile_id, list(tags), build_name, joined_subdir, metadata
@staticmethod
def get_display_name(sha):