grim/convey

Parents 83977b4d7654
Children e31d4e7f447b
Replace the always examples with a stage-run.yml example. Fixes #107
--- a/REFERENCE.md Mon Sep 04 22:38:16 2017 -0500
+++ b/REFERENCE.md Mon Sep 04 22:51:01 2017 -0500
@@ -8,14 +8,6 @@
There are a handful of examples in the [examples/](examples/) directory.
-## always.yml
-
-This example shows how the always stage attribute works and how it can be used to run a stage to report a build status, run clean up, or whatever.
-
-## always-simple.yml
-
-A much easier to follow version of having stages always run.
-
## bitbucket.yml
This example shows how to use the convey/bitbucket-upload image to upload files to a Bitbucket repository's downloads section.
@@ -44,6 +36,10 @@
This example shows how you can specify an ssh identity to automatically turn on ssh-agent forwarding.
+## stage-run.yml
+
+A simple example showing how to use the run attribute of a stage.
+
## traditional.yml
This example shows your traditional clone, test, build, deploy, and report for a project.
--- a/examples/always-simple.yml Mon Sep 04 22:38:16 2017 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-tasks:
- one:
- image: gliderlabs/alpine:edge
- shell: /bin/sh
- script:
- - true
- two:
- image: gliderlabs/alpine:edge
- shell: /bin/sh
- script:
- - false
- three:
- image: gliderlabs/alpine:edge
- shell: /bin/sh
- script:
- - false
- four:
- image: gliderlabs/alpine:edge
- shell: /bin/sh
- script:
- - true
-plans:
- default:
- stages:
- - tasks: [one, two]
- - tasks: [three, four]
- always: true
- concurrent: true
--- a/examples/always.yml Mon Sep 04 22:38:16 2017 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-tasks:
- # define a task that fails
- fail:
- image: gliderlabs/alpine:edge
- command: false
- # define a task that passes
- pass:
- image: gliderlabs/alpine:edge
- command: true
-plans:
- # run a task that passes, then one that fails without the always flag set
- pass-then-fail:
- stages:
- - tasks: [pass]
- - tasks: [fail]
- # run a task that fails, then one that passes with the always flag set to
- # true
- fail-then-pass:
- stages:
- - tasks: [fail]
- - tasks: [pass]
- always: true
- # run multiple stages, with a task failing in the second, when the thrid
- # stage is set to always run.
- complicated:
- stages:
- - tasks: [pass, pass]
- - tasks: [fail, pass]
- concurrent: true
- - tasks: [pass, fail]
- always: true
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/stage-run.yml Mon Sep 04 22:51:01 2017 -0500
@@ -0,0 +1,31 @@
+tasks:
+ fail:
+ image: gliderlabs/alpine:edge
+ schell: /bin/sh
+ script:
+ - false
+ success:
+ image: gliderlabs/alpine:edge
+ shell: /bin/sh
+ script:
+ - echo "success"
+ failure:
+ image: gliderlabs/alpine:edge
+ shell: /bin/sh
+ script:
+ - echo "failure"
+ cleanup:
+ image: gliderlabs/alpine:edge
+ shell: /bin/sh
+ script:
+ - echo "cleanup"
+plans:
+ default:
+ stages:
+ - tasks: fail
+ - tasks: success
+ run: on-success
+ - tasks: failure
+ run: on-failure
+ - tasks: cleanup
+ run: always