Skip to content
Snippets Groups Projects
Commit fee528fa authored by ale's avatar ale
Browse files

Update integration with gitlab-review-float-env-dashboard

The request payload needs an update with Gitlab CI specific info.
parent 4a5922a8
No related branches found
No related tags found
No related merge requests found
Pipeline #87605 failed
...@@ -49,8 +49,12 @@ def do_request(url, ssh_gw, payload): ...@@ -49,8 +49,12 @@ def do_request(url, ssh_gw, payload):
def encode_dashboard_request(req): def encode_dashboard_request(req):
# JSON data, in a raw zlib stream, base64-encoded. # JSON data, in a raw zlib stream, base64-encoded.
hosts = sorted(req['hosts'], key=lambda x: x['name']) payload = {
data = json.dumps(hosts, separators=(',', ':')).encode('utf-8') 'inv': sorted(req['hosts'], key=lambda x: x['name']),
'job': os.getenv('CI_JOB_ID'),
'proj': os.getenv('CI_PROJECT_PATH'),
}
data = json.dumps(payload, separators=(',', ':')).encode('utf-8')
comp = zlib.compressobj(level=9, wbits=-9) comp = zlib.compressobj(level=9, wbits=-9)
comp.compress(data) comp.compress(data)
return base64.urlsafe_b64encode(comp.flush()).decode('ascii') return base64.urlsafe_b64encode(comp.flush()).decode('ascii')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment