-
Notifications
You must be signed in to change notification settings - Fork 11
/
pipeline-staging.yml
132 lines (116 loc) · 3.43 KB
/
pipeline-staging.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
---
#@ load("funcs.lib.yml", "slack_hook")
#@ load("@ytt:data", "data")
#@ load("@ytt:template", "template")
#! JOBS
jobs:
- name: set-pipeline
plan:
- get: src
resource: src-((deploy-env))
params: { depth: 1 }
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-staging.yml
- set_pipeline: build-container
file: compiled/set-pipeline.yml
instance_vars:
deploy-env: ((deploy-env))
- name: update-release-branch
plan:
- get: src
resource: src-((deploy-env))
trigger: true
- get: general-task
- get: pipeline-tasks
- task: update-release-branch
image: general-task
file: pipeline-tasks/tasks/update-release-branch.yml
- name: test-((deploy-env))
plan:
- get: src
resource: src-((deploy-env))
trigger: true
params: { depth: 1 }
passed: [set-pipeline]
- get: python
- task: test
image: python
file: src/ci/partials/test.yml
on_failure: #@ slack_hook("failure", "tests")
- name: deploy-((deploy-env))
plan:
- get: src
resource: src-((deploy-env))
trigger: true
params: { depth: 1 }
passed: [test-((deploy-env)), audit-dependencies]
- 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_success: #@ slack_hook("success", "deployment")
on_failure: #@ slack_hook("failure", "deployment")
- name: audit-dependencies
plan:
- get: src
resource: src-((deploy-env))
trigger: true
passed: [set-pipeline]
- get: python
- task: pip-audit
image: python
file: src/ci/partials/audit.yml
on_failure: #@ slack_hook("failure", "dependency audit")
on_success: #@ slack_hook("success", "dependency audit")
#! RESOURCES
resources:
- name: src-((deploy-env))
type: git
icon: github
source:
uri: [email protected]:/((build-container-repository-path))
branch: main
commit_verification_keys: ((cloud-gov-pages-gpg-keys))
private_key: ((pages-gpg-operations-github-sshkey.private_key))
- 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