summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Holland <william.holland@codethink.co.uk>2015-09-28 07:58:22 +0100
committerWill Holland <william.holland@codethink.co.uk>2015-09-28 07:58:22 +0100
commitbbde322eaf23c338882a74036a859577b8776751 (patch)
treefa23a77572d4206422f8f6ff4ac14b47e74cccb9
parent0052f744f737d09915c2636adccebb5f65d3692b (diff)
downloadbuildslave-scripts-bbde322eaf23c338882a74036a859577b8776751.tar.gz
Send slavename to master when build complete
This will be useful for many-to-many build-deploy relationship with multiple slaves so that a deploy knows where the builds are.
-rw-r--r--builder_logic.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/builder_logic.py b/builder_logic.py
index fe6c59c..71c5c1d 100644
--- a/builder_logic.py
+++ b/builder_logic.py
@@ -67,6 +67,14 @@ def build(system):
log('build complete')
return exit_val
+def get_slave_name():
+ ''' return the name the slave was created with by buildslave assuming the
+ cwd looks something like
+ /home/ciat/orchestration/orchenv-slave/slave/2__x86_64_Build/build/ybdenv
+ '''
+ dir = os.getcwd()
+ return dir.split('/',)[-4]
+
def trigger_deploy(system):
import platform
import requests
@@ -84,6 +92,7 @@ def trigger_deploy(system):
if not system: return 0
payload = {
'system':system,
+ 'slave':get_slave_name(),
'buildslave_scripts_sha':buildslave_scripts_sha,
'definitions_sha':definitions_sha,
'testing_sha':testing_sha,