summaryrefslogtreecommitdiff
path: root/yarns/400-build.yarn
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-04-19 22:31:01 +0300
committerLars Wirzenius <liw@liw.fi>2018-04-19 22:31:01 +0300
commitf11a8ecd409f280759af7227db52b1e87e389092 (patch)
tree191dc9e4dda2444fb65bcf097056ef37d5a685bc /yarns/400-build.yarn
parent04e899ded340bc0fd3afd6b0a62dff22c182e735 (diff)
downloadick2-f11a8ecd409f280759af7227db52b1e87e389092.tar.gz
Change: trigger a project, build all pipelines in the project
Diffstat (limited to 'yarns/400-build.yarn')
-rw-r--r--yarns/400-build.yarn64
1 files changed, 16 insertions, 48 deletions
diff --git a/yarns/400-build.yarn b/yarns/400-build.yarn
index 3ee30a6..796bd20 100644
--- a/yarns/400-build.yarn
+++ b/yarns/400-build.yarn
@@ -32,8 +32,8 @@ Set up the controller.
AND an access token for user with scopes
... uapi_pipelines_post
... uapi_projects_post
- ... uapi_projects_id_pipelines_id_put
- ... uapi_projects_id_pipelines_id_get
+ ... uapi_projects_id_status_put
+ ... uapi_projects_id_status_get
... uapi_projects_id_builds_get
... uapi_workers_id_get
... uapi_builds_get
@@ -76,7 +76,7 @@ Add a second project so we know each project gets its own work steps.
There are no builds for the project yet, and is idle.
- WHEN user makes request GET /projects/rome/pipelines/construct
+ WHEN user makes request GET /projects/rome/status
THEN result has status code 200
AND body matches { "status": "idle" }
@@ -98,11 +98,11 @@ Register a worker.
Trigger build. First with an invalid status, then a real one.
- WHEN user makes request PUT /projects/rome/pipelines/construct
+ WHEN user makes request PUT /projects/rome/status
... with a valid token and body { "status": "VANDALS!" }
THEN result has status code 400
- WHEN user makes request PUT /projects/rome/pipelines/construct
+ WHEN user makes request PUT /projects/rome/status
... with a valid token and body { "status": "triggered" }
THEN result has status code 200
@@ -122,7 +122,6 @@ the worker to construct a new workspace for the build.
... "log": "/logs/rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "parameters": {
... "foo": "bar"
... },
@@ -140,7 +139,6 @@ the worker to construct a new workspace for the build.
... "log": "/logs/rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "parameters": {
... "foo": "bar"
... },
@@ -151,7 +149,7 @@ the worker to construct a new workspace for the build.
User can now see pipeline is running and which worker is building it.
- WHEN user makes request GET /projects/rome/pipelines/construct
+ WHEN user makes request GET /projects/rome/status
THEN result has status code 200
AND body matches
... {
@@ -169,7 +167,6 @@ User can now see pipeline is running and which worker is building it.
... "log": "/logs/rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "parameters": {
... "foo": "bar"
... },
@@ -190,7 +187,6 @@ User can now see pipeline is running and which worker is building it.
... "log": "/logs/rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "actions": [
... { "action": "create_workspace" },
... { "shell": "day 1" },
@@ -218,7 +214,6 @@ Worker reports workspace creation is done. Note the zero exit code.
... "build_id": "rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "exit_code": 0,
... "stdout": "",
... "stderr": "",
@@ -237,7 +232,6 @@ Worker requests more work, and gets the first actual build step.
... "log": "/logs/rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "parameters": {
... "foo": "bar"
... },
@@ -254,7 +248,6 @@ hasn't finished yet.
... "build_id": "rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "exit_code": null,
... "stdout": "hey ho",
... "stderr": "",
@@ -274,7 +267,6 @@ didnt't finish.
... "log": "/logs/rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "parameters": {
... "foo": "bar"
... },
@@ -297,7 +289,6 @@ Report the step is done, and successfully.
... "build_id": "rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "exit_code": 0,
... "stdout": ", hey ho\n",
... "stderr": "",
@@ -323,7 +314,6 @@ The build status now shows the next step as the active one.
... "log": "/logs/rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "actions": [
... { "action": "create_workspace" },
... { "shell": "day 1" },
@@ -350,7 +340,6 @@ Now there's another step to do.
... "log": "/logs/rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "parameters": {
... "foo": "bar"
... },
@@ -371,7 +360,6 @@ User sees changed status.
... "build_number": 1,
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "parameters": {
... "foo": "bar"
... },
@@ -389,7 +377,6 @@ Report it done.
... "build_id": "rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "exit_code": 0,
... "stdout": "to the gold mine we go!\n",
... "stderr": "",
@@ -405,7 +392,7 @@ Now there's no more work to do.
The pipeline status indicates success.
- WHEN user makes request GET /projects/rome/pipelines/construct
+ WHEN user makes request GET /projects/rome/status
THEN result has status code 200
AND body matches { "status": "idle" }
@@ -423,7 +410,6 @@ no current action.
... "log": "/logs/rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "actions": [
... { "action": "create_workspace" },
... { "shell": "day 1" },
@@ -447,7 +433,6 @@ no current action.
... "log": "/logs/rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "actions": [
... { "action": "create_workspace" },
... { "shell": "day 1" },
@@ -467,7 +452,7 @@ no current action.
Start build again. This should become build number 2.
- WHEN user makes request PUT /projects/rome/pipelines/construct
+ WHEN user makes request PUT /projects/rome/status
... with a valid token and body { "status": "triggered" }
THEN result has status code 200
@@ -480,7 +465,6 @@ Start build again. This should become build number 2.
... "log": "/logs/rome/2",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "parameters": {
... "foo": "bar"
... },
@@ -500,7 +484,6 @@ Start build again. This should become build number 2.
... "log": "/logs/rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "actions": [
... { "action": "create_workspace" },
... { "shell": "day 1" },
@@ -518,7 +501,6 @@ Start build again. This should become build number 2.
... "log": "/logs/rome/2",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "actions": [
... { "action": "create_workspace" },
... { "shell": "day 1" },
@@ -538,7 +520,6 @@ Start build again. This should become build number 2.
... "build_id": "rome/2",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "exit_code": 0,
... "stdout": "",
... "stderr": "",
@@ -555,7 +536,6 @@ Start build again. This should become build number 2.
... "log": "/logs/rome/2",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "parameters": {
... "foo": "bar"
... },
@@ -569,7 +549,6 @@ Start build again. This should become build number 2.
... "build_id": "rome/2",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "exit_code": 0,
... "stdout": "hey ho",
... "stderr": "",
@@ -585,7 +564,6 @@ Start build again. This should become build number 2.
... "build_id": "rome/2",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "exit_code": 0,
... "stdout": "hey ho",
... "stderr": "",
@@ -604,7 +582,6 @@ Start build again. This should become build number 2.
... "log": "/logs/rome/1",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "actions": [
... { "action": "create_workspace" },
... { "shell": "day 1" },
@@ -622,7 +599,6 @@ Start build again. This should become build number 2.
... "log": "/logs/rome/2",
... "worker": "obelix",
... "project": "rome",
- ... "pipeline": "construct",
... "actions": [
... { "action": "create_workspace" },
... { "shell": "day 1" },
@@ -655,8 +631,8 @@ Set up the controller.
AND an access token for user with scopes
... uapi_pipelines_post
... uapi_projects_post
- ... uapi_projects_id_pipelines_id_put
- ... uapi_projects_id_pipelines_id_get
+ ... uapi_projects_id_status_put
+ ... uapi_projects_id_status_get
... uapi_projects_id_builds_get
... uapi_workers_id_get
... uapi_builds_get
@@ -701,7 +677,7 @@ Register a worker.
Build the first project.
- WHEN user makes request PUT /projects/first/pipelines/do_something
+ WHEN user makes request PUT /projects/first/status
... with a valid token and body { "status": "triggered" }
THEN result has status code 200
@@ -717,7 +693,6 @@ Build the first project.
... "build_number": 1,
... "worker": "obelix",
... "project": "first",
- ... "pipeline": "do_something",
... "exit_code": 0,
... "stdout": "",
... "stderr": "",
@@ -737,7 +712,6 @@ Build the first project.
... "build_number": 1,
... "worker": "obelix",
... "project": "first",
- ... "pipeline": "do_something",
... "exit_code": 0,
... "stdout": "",
... "stderr": "",
@@ -750,7 +724,7 @@ Build the first project.
Build second project.
- WHEN user makes request PUT /projects/second/pipelines/do_something
+ WHEN user makes request PUT /projects/second/status
... with a valid token and body { "status": "triggered" }
THEN result has status code 200
@@ -765,7 +739,6 @@ Build second project.
... "build_id": "second/1",
... "worker": "obelix",
... "project": "second",
- ... "pipeline": "do_something",
... "exit_code": 0,
... "stdout": "",
... "stderr": "",
@@ -784,7 +757,6 @@ Build second project.
... "build_id": "second/1",
... "worker": "obelix",
... "project": "second",
- ... "pipeline": "do_something",
... "exit_code": 0,
... "stdout": "",
... "stderr": "",
@@ -815,8 +787,8 @@ Set up the controller.
AND an access token for user with scopes
... uapi_pipelines_post
... uapi_projects_post
- ... uapi_projects_id_pipelines_id_put
- ... uapi_projects_id_pipelines_id_get
+ ... uapi_projects_id_status_put
+ ... uapi_projects_id_status_get
... uapi_projects_id_builds_get
... uapi_workers_id_get
... uapi_builds_get
@@ -873,7 +845,7 @@ Register a couple of workers.
Trigger both projects.
- WHEN user makes request PUT /projects/first/pipelines/do_something
+ WHEN user makes request PUT /projects/first/status
... with a valid token and body { "status": "triggered" }
THEN result has status code 200
@@ -889,7 +861,7 @@ Trigger both projects.
WHEN user requests list of builds
THEN the list of builds is ["first/1"]
- WHEN user makes request PUT /projects/second/pipelines/do_something
+ WHEN user makes request PUT /projects/second/status
... with a valid token and body { "status": "triggered" }
THEN result has status code 200
@@ -908,7 +880,6 @@ Trigger both projects.
... "build_number": 1,
... "worker": "asterix",
... "project": "first",
- ... "pipeline": "do_something",
... "exit_code": 0,
... "stdout": "",
... "stderr": "",
@@ -934,7 +905,6 @@ Trigger both projects.
... "build_number": 1,
... "worker": "obelix",
... "project": "second",
- ... "pipeline": "do_something",
... "exit_code": 0,
... "stdout": "",
... "stderr": "",
@@ -953,7 +923,6 @@ Trigger both projects.
... "build_id": "first/1",
... "worker": "asterix",
... "project": "first",
- ... "pipeline": "do_something",
... "exit_code": 0,
... "stdout": "",
... "stderr": "",
@@ -969,7 +938,6 @@ Trigger both projects.
... "build_id": "second/1",
... "worker": "obelix",
... "project": "second",
- ... "pipeline": "do_something",
... "exit_code": 0,
... "stdout": "",
... "stderr": "",