summaryrefslogtreecommitdiff
path: root/builder_logic.py
diff options
context:
space:
mode:
authorWill Holland <william.holland@codethink.co.uk>2015-09-10 14:24:37 +0100
committerWill Holland <william.holland@codethink.co.uk>2015-09-10 14:26:08 +0100
commitd5523e20b799995a2d9df14910ed96ce53ea2bcf (patch)
tree5c9a8cbce49fd474ddef192bc929608ad09d77eb /builder_logic.py
parent1868baf1ba3602ce7cef3b59eccab1b499cfb6a5 (diff)
downloadbuildslave-scripts-d5523e20b799995a2d9df14910ed96ce53ea2bcf.tar.gz
Fix assuming it is on the correct branch
Diffstat (limited to 'builder_logic.py')
-rw-r--r--builder_logic.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/builder_logic.py b/builder_logic.py
index 8f3b56c..c5fc188 100644
--- a/builder_logic.py
+++ b/builder_logic.py
@@ -4,6 +4,7 @@ ORCHE_URL = 'http://127.0.0.1:8080/'
BUILD_SCRIPT = 'bild_a_system.sh'
DEPLOY_SCRIPT = 'deploy_a_system.sh'
DEFINITIONS_DIR='/home/patrickdarley/definitions'
+REF = "cu010-trove/br6/firehose-test-1"
whitelist = [
'clusters/tlsa.morph',
@@ -19,7 +20,11 @@ def files_changed():
import os
owd = os.getcwd()
os.chdir(DEFINITIONS_DIR)
- cmd = ['git', 'diff', '--name-only', 'HEAD~1', 'HEAD']
+ SHAcmd = ['git', 'log', REF, '--format=format:%H', '-2']
+ SHAproc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+ SHAout, SHAerr = p.communicate()
+ SHA = SHAout.split()
+ cmd = ['git', 'diff', '--name-only', SHA[0], SHA[1]]
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
out, err = p.communicate()
os.chdir(owd)