forked from vmware-archive/concourse-pipeline-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgated-pipeline-02-shipit.yml
115 lines (111 loc) · 2.71 KB
/
gated-pipeline-02-shipit.yml
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
resources:
- name: fly-release
type: github-release
source:
user: concourse
repository: concourse
access_token: {{github-access-token}}
- name: send-email
type: email
source:
from: YOUR-SENDER-EMAIL-GOES-HERE
jobs:
- name: Build-it
plan:
- get: fly-release
params:
globs:
- fly_linux_amd64
trigger: true
- task: do-your-build-task-here
config:
platform: linux
image_resource:
type: docker-image
source:
repository: concourse/buildroot
tag: "git"
run:
path: sh
args:
- -exc
- |
echo "Output of build job. It gets automatically triggered by any changes in the resource."
- name: Test-it
plan:
- get: fly-release
params:
globs:
- fly_linux_amd64
passed:
- Build-it
trigger: true
- task: do-your-test-task-here
config:
platform: linux
image_resource:
type: docker-image
source:
repository: concourse/buildroot
tag: "git"
run:
path: sh
args:
- -exc
- |
echo "Output of test job. It gets automatically triggered after a successful Build-it job."
- task: prep-email-text
config:
platform: linux
image_resource:
type: docker-image
source:
repository: concourse/buildroot
tag: "git"
inputs:
- name: fly-release
outputs:
- name: email-text
run:
path: sh
args:
- -exc
- |
export LATEST_GOOD_VERSION=$(cat ./fly-release/version)
# export LATEST_GOOD_VERSION=$(cd my-resource && git rev-parse --short HEAD && cd ..)
echo "Version $LATEST_GOOD_VERSION is ready to ship!" > ./email-text/email-subject.txt
echo "Version $LATEST_GOOD_VERSION is ready to ship! For details, see pipeline {{ BUILD_PIPELINE_NAME }}, job {{ BUILD_JOB_NAME }}, build {{ BUILD_NAME }}." > ./email-text/email-body.txt
- put: send-email
params:
to: [YOUR-EMAIL-GOES-HERE]
subject: ./email-text/email-subject.txt
body: ./email-text/email-body.txt
- name: Ship-it!
plan:
- get: fly-release
params:
globs:
- fly_linux_amd64
passed:
- Test-it
trigger: false
- task: do-your-shipit-task-here
config:
platform: linux
image_resource:
type: docker-image
source:
repository: concourse/buildroot
tag: "git"
run:
path: sh
args:
- -exc
- |
echo "Output of your manually triggered Ship-it task."
resource_types:
- name: email
type: docker-image
source:
repository: mdomke/concourse-email-resource