-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dispatchfile.yaml
85 lines (85 loc) · 1.86 KB
/
Dispatchfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!yaml
resource:
src-repo:
type: git
param:
url: "$(context.git.url)"
revision: "$(context.git.commit)"
gitops-repo:
type: git
param:
url: https://github.com/mesosphere/devx-dispatch-gitops-demo
docker-image:
type: image
param:
url: mesosphere/devx-dispatch-demo
task:
unit-test:
inputs:
- src-repo
steps:
- name: go-test
env:
- name: SLEEP_DURATION
value: 5s
image: golang:1.13.0-buster
command:
- go
- test
- "./..."
workingDir: "/workspace/src-repo"
build-image:
inputs:
- src-repo
steps:
- name: build-and-push
env:
- name: DOCKER_CONFIG
value: "/builder/home/.docker"
image: gcr.io/kaniko-project/executor
args:
- "--destination=$(outputs.resources.docker-image.url)"
- "--context=/workspace/src-repo"
- "--oci-layout-path=/builder/home/image-outputs/docker-image"
- "--dockerfile=/workspace/src-repo/Dockerfile"
outputs:
- docker-image
deps:
- unit-test
integration-test:
inputs:
- docker-image
steps:
- name: run-test
env:
- name: SLEEP_DURATION
value: 5s
image: "$(inputs.resources.docker-image.url)@$(inputs.resources.docker-image.digest)"
command:
- "/hello-app.test"
deploy:
inputs:
- docker-image
- gitops-repo
steps:
- name: update-gitops-repo
image: mesosphere/update-gitops-repo:v1.0
workingDir: "/workspace/gitops-repo"
args:
- "-git-revision=$(context.git.commit)"
- "-substitute=imageName=$(inputs.resources.docker-image.url)@$(inputs.resources.docker-image.digest)"
deps:
- integration-test
actions:
- tasks:
- deploy
'on':
push:
branches:
- master
- tasks:
- integration-test
'on':
pull_request:
chatops:
- test