Implement extends

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2015-03-18 13:51:27 -07:00
commit 4c582e4352
11 changed files with 421 additions and 28 deletions

12
tests/fixtures/extends/circle-1.yml vendored Normal file
View file

@ -0,0 +1,12 @@
foo:
image: busybox
bar:
image: busybox
web:
extends:
file: circle-2.yml
service: web
baz:
image: busybox
quux:
image: busybox

12
tests/fixtures/extends/circle-2.yml vendored Normal file
View file

@ -0,0 +1,12 @@
foo:
image: busybox
bar:
image: busybox
web:
extends:
file: circle-1.yml
service: web
baz:
image: busybox
quux:
image: busybox

6
tests/fixtures/extends/common.yml vendored Normal file
View file

@ -0,0 +1,6 @@
web:
image: busybox
command: /bin/true
environment:
- FOO=1
- BAR=1

View file

@ -0,0 +1,16 @@
myweb:
extends:
file: common.yml
service: web
command: sleep 300
links:
- "mydb:db"
environment:
# leave FOO alone
# override BAR
BAR: "2"
# add BAZ
BAZ: "2"
mydb:
image: busybox
command: sleep 300

View file

@ -0,0 +1,6 @@
webintermediate:
extends:
file: common.yml
service: web
environment:
- "FOO=2"

6
tests/fixtures/extends/nested.yml vendored Normal file
View file

@ -0,0 +1,6 @@
myweb:
extends:
file: nested-intermediate.yml
service: webintermediate
environment:
- "BAR=2"