-
Notifications
You must be signed in to change notification settings - Fork 11
/
pipeline-dev.yml
172 lines (152 loc) · 4.24 KB
/
pipeline-dev.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
---
#@ load("funcs.lib.yml", "slack_hook")
#@ load("@ytt:data", "data")
#@ load("@ytt:template", "template")
#! JOBS
jobs:
- name: set-pipeline
plan:
- get: src
resource: pr-((deploy-env))
trigger: true
- get: pipeline-tasks
- get: general-task
- task: init
image: general-task
file: pipeline-tasks/tasks/init.yml
params:
PIPELINE_YML: src/ci/pipeline-dev.yml
- set_pipeline: build-container
file: compiled/set-pipeline.yml
instance_vars:
deploy-env: ((deploy-env))
- name: test-((deploy-env))
plan:
- get: src
resource: pr-((deploy-env))
trigger: true
passed: [set-pipeline]
- put: src
resource: pr-((deploy-env))
params:
path: src
status: pending
base_context: concourse
context: test-pages-build-container-((deploy-env))
- get: python
- task: test
image: python
file: src/ci/partials/test.yml
on_success:
put: src
resource: pr-((deploy-env))
params:
path: src
status: success
base_context: concourse
context: test-pages-build-container-((deploy-env))
on_failure:
in_parallel:
- put: src
resource: pr-((deploy-env))
params:
path: src
status: failure
base_context: concourse
context: test-pages-build-container-((deploy-env))
- #@ slack_hook("failure", "tests")
- name: deploy-((deploy-env))
plan:
- get: src
resource: pr-((deploy-env))
trigger: true
passed: [test-((deploy-env))]
- get: general-task
- get: oci-build-task
- task: build
privileged: true
image: oci-build-task
file: src/ci/partials/build.yml
- put: image-repository
params:
image: image/image.tar
- task: deploy
image: general-task
file: src/ci/partials/deploy.yml
params:
_: #@ template.replace(data.values.env_cf)
CF_APP_NAME: pages-build-container-((deploy-env))
CF_MANIFEST: .cloudgov/manifest.yml
CF_VARS_FILE: .cloudgov/vars/pages-((deploy-env)).yml
IMAGE_REPOSITORY: ../image-repository/repository
IMAGE_TAG: pages-((deploy-env))
CF_DOCKER_USERNAME: ((ecr-aws-key))
CF_DOCKER_PASSWORD: ((ecr-aws-secret))
on_failure: #@ slack_hook("failure", "deployment")
- name: audit-dependencies
plan:
- get: src
resource: pr-((deploy-env))
trigger: true
passed: [set-pipeline]
- put: src
resource: pr-((deploy-env))
params:
path: src
status: pending
base_context: concourse
context: audit-dependencies
- get: python
- task: pip-audit
image: python
file: src/ci/partials/audit.yml
on_failure:
in_parallel:
- put: src
resource: pr-((deploy-env))
params:
path: src
status: failure
base_context: concourse
context: audit-dependencies
- #@ slack_hook("failure", "dependency audit")
on_success:
in_parallel:
- put: src
resource: pr-((deploy-env))
params:
path: src
status: success
base_context: concourse
context: audit-dependencies
- #@ slack_hook("success", "dependency audit")
#! RESOURCES
resources:
- name: pr-((deploy-env))
type: pull-request
check_every: 1m
source:
repository: ((build-container-repository-path))
access_token: ((gh-access-token))
base_branch: main
disable_forks: true
ignore_drafts: false
- name: image-repository
type: registry-image
source:
aws_access_key_id: ((ecr-aws-key))
aws_secret_access_key: ((ecr-aws-secret))
repository: pages-build-container
aws_region: us-gov-west-1
tag: pages-((deploy-env))
- name: slack
- name: pipeline-tasks
- name: python
- name: general-task
- name: oci-build-task
#! RESOURCE TYPES
resource_types:
- name: git
- name: slack-notification
- name: pull-request
- name: registry-image