summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-08-04 19:00:39 +0300
committerLars Wirzenius <liw@liw.fi>2019-08-04 19:00:39 +0300
commit1ea1aaa10f1f2156f32989f92ebf13b09f3d5d7a (patch)
treed9a73d3fa45924cac4091cda1155dad950f805aa
parent48cf7c7ea0325fb3644788ea1bbef19318fc0869 (diff)
downloadick2-ansible-1ea1aaa10f1f2156f32989f92ebf13b09f3d5d7a.tar.gz
Add: scripts to create clients, Ick workers in Qvisqve
-rwxr-xr-xcreate-user41
-rwxr-xr-xcreate-worker23
2 files changed, 64 insertions, 0 deletions
diff --git a/create-user b/create-user
new file mode 100755
index 0000000..2ef21b7
--- /dev/null
+++ b/create-user
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -eu
+
+scopes="
+uapi_blobs_id_get
+uapi_blobs_id_put
+uapi_builds_get
+uapi_builds_id_delete
+uapi_builds_id_get
+uapi_logs_get
+uapi_logs_id_delete
+uapi_logs_id_get
+uapi_pipelines_get
+uapi_pipelines_id_delete
+uapi_pipelines_id_get
+uapi_pipelines_id_put
+uapi_pipelines_post
+uapi_projects_get
+uapi_projects_id_delete
+uapi_projects_id_get
+uapi_projects_id_put
+uapi_projects_id_status_get
+uapi_projects_id_status_put
+uapi_projects_post
+uapi_status_get
+uapi_version_get
+uapi_workers_get
+uapi_workers_id_delete
+uapi_workers_id_get
+
+
+
+"
+
+api="$1"
+name="$2"
+secret="$3"
+
+qvisqvetool -a "$api" create client "$name" "$secret"
+qvisqvetool -a "$api" allow-scope client "$name" $scopes
diff --git a/create-worker b/create-worker
new file mode 100755
index 0000000..2254faf
--- /dev/null
+++ b/create-worker
@@ -0,0 +1,23 @@
+#!/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
+"
+
+api="$1"
+name="$2"
+secret="$3"
+
+qvisqvetool -a "$api" create client "$name" "$secret"
+qvisqvetool -a "$api" allow-scope client "$name" $scopes