-
Notifications
You must be signed in to change notification settings - Fork 14
/
pipeline.yml
210 lines (194 loc) · 5.3 KB
/
pipeline.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
---
#@ load("funcs.lib.yml", "slack_hook", "pr_hook")
#@ load("@ytt:data", "data")
#@ load("@ytt:template", "template")
#@ env = data.values.env
#! JOBS
jobs:
- name: set-pipeline
plan:
- get: src
trigger: true
params:
#@ if/end env != 'dev':
depth: 1
#@ if/end env == 'dev':
integration_tool: checkout
- get: pipeline-tasks
- get: general-task
- task: boot
image: general-task
file: pipeline-tasks/tasks/boot.yml
params:
ENV_OVERRIDE: ((deploy-env))
- set_pipeline: self
file: compiled/set-pipeline.yml
instance_vars:
deploy-env: ((deploy-env))
- name: test-and-deploy
plan:
- get: src
passed: [set-pipeline]
trigger: true
params:
#@ if/end env != 'dev':
depth: 1
#@ if/end env == 'dev':
integration_tool: checkout
- get: nginx
params:
format: oci
- get: node
- get: node-oci
resource: node
params:
format: oci
- get: general-task
- get: pipeline-tasks
- get: dind
- in_parallel:
- task: test-mock
privileged: true
image: dind
file: src/ci/partials/test-mocks.yml
- task: test-integration
image: dind
privileged: true
params:
DEDICATED_AWS_ACCESS_KEY_ID: ((dedicated-aws-access-key-id))
DEDICATED_AWS_SECRET_ACCESS_KEY: ((dedicated-aws-secret-access-key))
file: src/ci/partials/test-integrations.yml
- task: build-redirects
image: node
file: src/ci/partials/build-redirects.yml
params:
SITE_REDIRECTS: ((pages-proxy-((deploy-env))-site-redirects))
- task: deploy
image: general-task
file: src/ci/partials/deploy.yml
params:
_: #@ template.replace(data.values.env_cf)
CF_APP_NAME: pages-proxy-((deploy-env))
CF_MANIFEST: .cloudgov/manifest.yml
CF_VARS_FILE: .cloudgov/vars/pages-((deploy-env)).yml
on_failure:
try:
task: cancel-api-deployment
image: general-task
file: src/ci/partials/cancel-deployment.yml
params:
_: #@ template.replace(data.values.env_cf)
CF_APP_NAME: pages-proxy-((deploy-env))
on_failure:
in_parallel:
- #@ slack_hook("failure", "deployment")
#@ if/end env == 'dev':
- #@ pr_hook("failed", "test-and-deploy-proxy")
on_success:
in_parallel:
- #@ slack_hook("success", "deployment")
#@ if/end env == 'dev':
- #@ pr_hook("success", "test-and-deploy-proxy")
- name: nightly-tasks
plan:
- get: src
passed: [set-pipeline]
params:
#@ if/end env != 'dev':
depth: 1
#@ if/end env == 'dev':
integration_tool: checkout
- get: general-task
- get: pipeline-tasks
- get: nightly
trigger: true
- task: restage
image: general-task
file: pipeline-tasks/tasks/restage.yml
params:
_: #@ template.replace(data.values.env_cf)
CF_APP_NAME: pages-proxy-((deploy-env))
#@ if/end env == 'staging':
- name: update-release-branch
plan:
- get: src
passed:
- set-pipeline
- test-and-deploy
trigger: true
- get: general-task
- get: pipeline-tasks
- task: update-release-branch
image: general-task
file: pipeline-tasks/tasks/update-release-branch.yml
#@ if/end env == 'production':
- name: release
plan:
- get: src
params:
depth: 1
trigger: true
passed:
- set-pipeline
- test-and-deploy
- #@ template.replace(data.values.release_steps)
#! RESOURCES
resources:
#@ if/end env == 'dev':
- name: src
type: pull-request
check_every: 1m
source:
repository: ((proxy-repository-path))
access_token: ((gh-access-token))
base_branch: main
disable_forks: true
ignore_drafts: false
#@ if/end env == 'staging':
- name: src
type: git
icon: github
source:
uri: [email protected]:cloud-gov/pages-proxy.git
branch: main
commit_verification_keys: ((cloud-gov-pages-gpg-keys))
private_key: ((pages-gpg-operations-github-sshkey.private_key))
#@ if env == 'production':
- name: src
type: git
icon: github
source:
uri: https://github.com/cloud-gov/pages-proxy.git
branch: main
commit_verification_keys: ((cloud-gov-pages-gpg-keys))
tag_filter: 1.*.*
fetch_tags: true
- name: pages-release
type: github-release
source:
owner: cloud-gov
repository: pages-proxy
access_token: ((gh-access-token))
#@ end
- name: nightly
type: time
source:
start: 12:00 AM
stop: 1:00 AM
location: America/New_York
- name: pipeline-tasks
- name: dind
- name: nginx
- name: slack
- name: node
- name: general-task
#! RESOURCE TYPES
resource_types:
- name: git
- name: slack-notification
- name: time
- name: registry-image
#@ if/end env == 'dev':
- name: pull-request
#@ if/end env == 'production':
- name: github-release