Skip to content
Snippets Groups Projects
Commit cfd806ae authored by Paul Bourke's avatar Paul Bourke
Browse files

Log the SHA of the Git ref for source builds

When using named refs in source builds, e.g. "reference = master", one
can't easily tell from the build output what SHA master actually pointed
to at that point and time. Update the debug output to include this.

Closes-Bug: #1566316

Change-Id: I95c1cc316ab7332fa30fa43e207a5a5512b76708
parent 5f6d4d10
No related branches found
No related tags found
No related merge requests found
......@@ -194,9 +194,10 @@ class WorkerThread(threading.Thread):
LOG.debug("%s:Cloning from %s", image['name'],
source['source'])
git.Git().clone(source['source'], clone_dir)
LOG.debug("%s:Git checkout by reference %s",
image['name'], source['reference'])
git.Git(clone_dir).checkout(source['reference'])
reference_sha = git.Git(clone_dir).rev_parse('HEAD')
LOG.debug("%s:Git checkout by reference %s (%s)",
image['name'], source['reference'], reference_sha)
except Exception as e:
LOG.error("%s:Failed to get source from git", image['name'])
LOG.error("%s:Error:%s", image['name'], str(e))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment