summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Bourke <paul.bourke@oracle.com>2016-04-05 12:03:47 +0100
committerPaul Bourke <paul.bourke@oracle.com>2016-04-05 13:31:03 +0000
commitcfd806aeff30818d2c1a909780f141ae0ac8dfef (patch)
tree8bac5094d1e84a3a706d271af1a73c09ad8758d2
parent5f6d4d10d4f8230335397ece9896d15ef542ceb9 (diff)
downloadkolla-cfd806aeff30818d2c1a909780f141ae0ac8dfef.tar.gz
kolla-cfd806aeff30818d2c1a909780f141ae0ac8dfef.zip
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
-rwxr-xr-xkolla/cmd/build.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py
index 1bb8d8076..f5a8ccef9 100755
--- a/kolla/cmd/build.py
+++ b/kolla/cmd/build.py
@@ -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))