generated from cloud-gov/.github
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipeline.yml
176 lines (158 loc) · 4.75 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
jobs:
- name: set-self
plan:
- get: cg-ui
trigger: true
- set_pipeline: self
file: cg-ui/ci/pipeline.yml
- name: test-and-deploy-app
plan:
- in_parallel:
- get: cg-ui
passed: [set-self]
trigger: true
- get: node
- get: postgres
- task: install-deps
file: cg-ui/ci/partials/install.yml
image: node
- in_parallel:
- task: lint-app
file: cg-ui/ci/partials/lint.yml
image: node
- task: test-app
privileged: true
file: cg-ui/ci/partials/test.yml
- put: create-db
resource: cf-cli-dev
params:
command: create-service
update_service: true
# Note, the RDS broker doesn't return the correct status while provisioning:
# https://github.com/18F/aws-broker/issues/59
# If a new deployment, manually re-trigger the build once the RDS is up.
wait_for_service: true
timeout: 1200 # RDS take a long time to provision
service_instance: cg-ui-datastore
service: aws-rds
plan: micro-psql
- put: create-s3
resource: cf-cli-dev
params:
command: create-service
update_service: true
service_instance: cg-ui-storage
service: s3
plan: basic
- put: cloud-gov-development
params:
manifest: cg-ui/manifest.yml
path: cg-ui
vars:
domain: dev.us-gov-west-1.aws-us-gov.cloud.gov
environment_variables:
CF_API_URL: ((dev-cf-api-url))/v3
OAUTH_CLIENT_SECRET: ((uaa-client-secret))
ROOT_URL: ((dev-app-root-url))
UAA_ROOT_URL: ((dev-uaa-root-url))
on_failure:
put: slack
params:
text: |
:x: FAILED to deploy cg-ui in development
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: '#18f-cloud-web-ui'
username: ((slack-username))
icon_url: ((slack-icon-url))
on_success:
put: slack
params:
text: |
:white_check_mark: Successfully deployed cg-ui in development
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: '#18f-cloud-web-ui'
username: ((slack-username))
icon_url: ((slack-icon-url))
resources:
- name: cg-ui
type: git
source:
commit_verification_keys: ((cloud-gov-pgp-keys))
uri: [email protected]:cloud-gov/cg-ui.git
branch: main
private_key: ((cg-ci-bot-sshkey.private_key))
- name: node
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: pages-node-v20
aws_region: us-gov-west-1
tag: latest
- name: postgres
type: registry-image
source:
repository: postgres
tag: 16-alpine
- name: slack
type: slack-notification
source:
url: ((slack-webhook-url))
- name: cloud-gov-development
type: cf
source:
api: ((dev-cf-api-url))
username: ((dev-cf-username))
password: ((dev-cf-password))
organization: cloud-gov
space: cg-ui
skip_cert_check: false
- name: cf-cli-dev
type: cf-cli-resource
source:
api: ((dev-cf-api-url))
username: ((dev-cf-username))
password: ((dev-cf-password))
org: cloud-gov
space: cg-ui
resource_types:
- name: registry-image
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: registry-image-resource
aws_region: us-gov-west-1
tag: latest
- name: slack-notification
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: slack-notification-resource
aws_region: us-gov-west-1
tag: latest
- name: git
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: git-resource
aws_region: us-gov-west-1
tag: latest
- name: cf
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: cf-resource
aws_region: us-gov-west-1
tag: latest
- name: cf-cli-resource
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: cf-cli-resource
aws_region: us-gov-west-1
tag: latest