-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpipeline.yml
167 lines (153 loc) · 4.38 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
---
jobs:
- name: run-tests
plan:
- in_parallel:
- get: cg-django-uaa-pr
trigger: true
- get: general-task
- put: cg-django-uaa-pr
params:
path: cg-django-uaa-pr
status: pending
- task: run-tests
image: general-task
file: cg-django-uaa-pr/ci/run-tests.yml
on_failure:
put: cg-django-uaa-pr
params:
path: cg-django-uaa-pr
status: failure
on_success:
put: cg-django-uaa-pr
params:
path: cg-django-uaa-pr
status: success
- name: set-self
plan:
- get: cg-django-uaa-repo
trigger: true
- set_pipeline: self
file: cg-django-uaa-repo/ci/pipeline.yml
- name: create-release
plan:
- in_parallel:
- get: cg-django-uaa-repo-tag
trigger: true
- get: general-task
- task: prepare-release
image: general-task
file: cg-django-uaa-repo-tag/ci/prepare-release.yml
- task: test-release
image: general-task
file: cg-django-uaa-repo-tag/ci/test-release.yml
- put: cg-django-uaa-release
params:
name: cg-django-uaa-repo-tag/tag
tag: cg-django-uaa-repo-tag/tag
generate_release_notes: true
globs:
- cg-django-uaa-repo-tag/dist/cg-django-uaa*
on_failure:
put: slack
params:
text: |
:x: FAILED to release cg-django-uaa
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-failure-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
on_success:
put: slack
params:
text: |
:white_check_mark: Successfully released cg-django-uaa
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
channel: ((slack-success-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
resources:
- name: cg-django-uaa-pr
type: pull-request
check_every: 1m
source:
repository: cloud-gov/cg-django-uaa
access_token: ((status-access-token))
disable_forks: true
# this resource is this repo
- name: cg-django-uaa-repo
type: git
source:
uri: https://github.com/cloud-gov/cg-django-uaa.git
branch: main
commit_verification_keys: ((cloud-gov-pgp-keys))
# this resource is this repo
# NOTE: we only execute on tag changes not commits, see tag_regex
- name: cg-django-uaa-repo-tag
type: git
source:
uri: https://github.com/cloud-gov/cg-django-uaa.git
# only run on new tags matching pattern like: v0.1.5
tag_regex: '^v([0-9]+\.){0,2}(\*|[0-9]+)$'
commit_verification_keys: ((cloud-gov-pgp-keys))
# This resource for posting to slack
- name: slack
type: slack-notification
source:
url: ((slack-webhook-url))
# Resource for creating a new release
- name: cg-django-uaa-release
type: github-release
source:
owner: cloud-gov
repository: cg-django-uaa
access_token: ((cg-ci-bot-ghtoken))
- name: general-task
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: general-task
aws_region: us-gov-west-1
tag: latest
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: pull-request
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: github-pr-resource
aws_region: us-gov-west-1
tag: latest
- name: github-release
type: registry-image
source:
aws_access_key_id: ((ecr_aws_key))
aws_secret_access_key: ((ecr_aws_secret))
repository: github-release-resource
aws_region: us-gov-west-1
tag: latest