From bbde322eaf23c338882a74036a859577b8776751 Mon Sep 17 00:00:00 2001 From: Will Holland Date: Mon, 28 Sep 2015 07:58:22 +0100 Subject: 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. --- builder_logic.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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, -- cgit v1.2.1