summaryrefslogtreecommitdiff
path: root/create-worker
blob: d2e0f4a60709af8b92fc69f2b3e4ff1cdd056ea7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

set -eu

scopes="
uapi_blobs_id_get
uapi_blobs_id_put
uapi_builds_id_get
uapi_logs_id_get
uapi_notify_post
uapi_projects_get
uapi_version_get
uapi_work_get
uapi_work_post
uapi_workers_post
create
update
show
delete
"

api="$1"
name="$2"
secret="$3"

qvisqvetool -a "$api" delete client "$name" || true
qvisqvetool -a "$api" create client "$name" "$secret"
qvisqvetool -a "$api" allow-scope client "$name" $scopes