summaryrefslogtreecommitdiff
path: root/worker_manager
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-04-30 17:24:27 +0300
committerLars Wirzenius <liw@liw.fi>2018-06-10 19:44:48 +0300
commitfd3fd66a1db8925e5a9a3d34acdd213f49378877 (patch)
tree5246b011f1cd035417fbca0a361b78fc630b2317 /worker_manager
parent9759c2b51a1250aa345c21b7cc6b793f4965ac2d (diff)
downloadick2-fd3fd66a1db8925e5a9a3d34acdd213f49378877.tar.gz
Add: notification service
Diffstat (limited to 'worker_manager')
-rwxr-xr-xworker_manager11
1 files changed, 10 insertions, 1 deletions
diff --git a/worker_manager b/worker_manager
index d0ee145..ab267d5 100755
--- a/worker_manager
+++ b/worker_manager
@@ -129,11 +129,14 @@ class ControllerAPI:
_scopes = ' '.join([
'uapi_version_get',
+ 'uapi_notify_post',
'uapi_work_get',
'uapi_work_post',
'uapi_workers_post',
'uapi_blobs_id_get',
'uapi_blobs_id_put',
+ 'uapi_builds_id_get',
+ 'uapi_logs_id_get',
])
def __init__(self, name, url):
@@ -145,6 +148,9 @@ class ControllerAPI:
self._client_id = None
self._client_secret = None
+ def get_controller_client(self):
+ return self._cc
+
def set_verify_tls(self, verify):
self._cc.set_verify_tls(verify)
@@ -199,10 +205,13 @@ class Worker:
def do_work(self, work):
project_name = work['project']
build_number = work['build_number']
+ build_id = work['build_id']
step = work.get('step', {})
params = work.get('parameters', {})
reporter = ick2.Reporter(self._api, work)
- af = ick2.ActionFactory(self._systree, self._workspace, reporter)
+ af = ick2.ActionFactory(
+ build_id, self._systree, self._workspace, reporter)
+ af.set_controller_client(self._api.get_controller_client())
af.set_token(self._api.get_token())
af.set_blob_url_func(self._api.get_blob_upload_url)
af.add_env_var('LC_ALL', 'C')