grim/convey

Add extends example.

2017-09-14, Eric Fritz
0fc998fd142f
Parents c265ab0c2248
Children cfe726d83002
Add extends example.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/base.yml Thu Sep 14 19:48:44 2017 -0500
@@ -0,0 +1,23 @@
+# This is the base file to extends.yml. It is a valid convey.yml file in its
+# own right and can be executed as such. However, the main use case for this
+# feature is to make "abstract" plans which may contain a useful toolset of
+# tasks across projects and environments.
+
+environment:
+ - PREFIX=YO
+
+tasks:
+ one:
+ image: gliderlabs/alpine:edge
+ command: echo "$PREFIX one"
+ two:
+ image: gliderlabs/alpine:edge
+ command: echo "$PREFIX two"
+
+plans:
+ plan1:
+ stages:
+ - tasks: [one]
+ plan2:
+ stages:
+ - tasks: [two]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/extends.yml Thu Sep 14 19:48:44 2017 -0500
@@ -0,0 +1,21 @@
+# This plan extends another plan by overwriting one of the tasks
+# and defining its own, then defining its own plan. The two are
+# merged where anything in the extending file overwrites the base.
+
+extends: base.yml
+
+environment:
+ - PREFIX=HEY
+
+tasks:
+ two:
+ image: gliderlabs/alpine:edge
+ command: echo "${PREFIX} TWO"
+ three:
+ image: gliderlabs/alpine:edge
+ command: echo "${PREFIX} three"
+
+plans:
+ default:
+ stages:
+ - tasks: [one, two, three]