/
config.yml
218 lines (213 loc) · 4.79 KB
/
config.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
211
212
213
214
215
216
217
218
version: 2.1
parameters:
GHA_Event:
type: string
default: ""
GHA_Actor:
type: string
default: ""
GHA_Action:
type: string
default: ""
GHA_Meta:
type: string
default: ""
defaults:
deploy: &deploy
requires:
- ci/staging/rack
filter-releases-any: &filter-releases-any
filters:
branches:
ignore:
- /.*/
# don't run release if pull request is from forked PR
# it can expose the env vars
- /pull\/[0-9]+/
tags:
only: /[0-9]{14}.*/
filter-releases-master: &filter-releases-master
filters:
branches:
ignore: /.*/
tags:
only: /[0-9]{14}/
workflows:
version: 2
cleanup:
jobs:
- cleanup
triggers:
- schedule:
cron: "0 7 * * *"
filters:
branches:
only:
- master
cleanup_all:
jobs:
- cleanup_all
triggers:
- schedule:
cron: "0 8,9 * * *"
filters:
branches:
only:
- master
test:
jobs:
- test
release:
jobs:
- ci:
<<: *filter-releases-any
name: ci/aws/public
provider: aws
- ci:
<<: *filter-releases-any
name: ci/aws/public-existing-vpc
provider: aws
args: "ExistingVpc=vpc-00e18642ac66249c5 InternetGateway=igw-0e2ed6542ed5343f2 Subnet0CIDR=172.0.1.0/24 Subnet1CIDR=172.0.2.0/24 Subnet2CIDR=172.0.3.0/24 SubnetPrivate0CIDR=172.0.4.0/24 SubnetPrivate1CIDR=172.0.5.0/24 SubnetPrivate2CIDR=172.0.6.0/24 VPCCIDR=172.0.0.0/16"
- ci:
<<: *filter-releases-any
name: ci/aws/public/arm64
provider: aws
args: "InstanceType=t4g.small BuildInstance=t4g.small"
- ci:
<<: *filter-releases-any
name: ci/aws/public/full-convox-yaml
provider: aws
action: "full-convox-yaml"
- ci:
<<: *filter-releases-any
name: ci/aws/private
provider: aws
args: Private=Yes
- ci:
<<: *filter-releases-any
type: approval
name: additional-tests
- ci:
requires:
- additional-tests
<<: *filter-releases-any
name: ci/aws/update
provider: aws
action: "update"
- ci:
requires:
- additional-tests
<<: *filter-releases-any
name: ci/aws/downgrade
provider: aws
action: "downgrade"
jobs:
ci:
parameters:
provider:
type: string
args:
type: string
default: ""
action:
type: string
default: ""
docker:
- image: cimg/go:1.18.0
environment:
PROVIDER: <<parameters.provider>>
ARGS: <<parameters.args>>
ACTION: <<parameters.action>>
steps:
- checkout
- ci-dependencies
- ci-install
- ci-apps-create
- ci-update
- ci-downgrade
- ci-test
- run:
command: ci/uninstall.sh
no_output_timeout: 90m
when: always
cleanup:
docker:
- image: cimg/go:1.18.0
steps:
- checkout
- ci-dependencies
- run: scripts/ci-cleanup
cleanup_all:
docker:
- image: cimg/go:1.18.0
steps:
- checkout
- ci-dependencies
- run: scripts/ci-cleanup all
deploy:
parameters:
app:
type: string
check:
type: string
repo:
type: string
docker:
- image: cimg/go:1.18.0
steps:
- checkout
- ci-dependencies
- run: ci/deploy.sh <<parameters.repo>> <<parameters.app>> <<parameters.check>>
test:
docker:
- image: cimg/go:1.18.0
# working_directory: /go/src/github.com/convox/rack
steps:
- checkout
- ci-dependencies
- run: go install ./cmd/convox
- run:
command: make test
no_output_timeout: 20m
- run: curl -s https://codecov.io/bash | bash
update:
docker:
- image: cimg/go:1.18.0
steps:
- checkout
- ci-dependencies
- run: ci/update.sh
commands:
ci-dependencies:
steps:
- run: ci/dependencies.sh
ci-install:
steps:
- run:
command: ci/install.sh
no_output_timeout: 20m
ci-update:
steps:
- run:
command: ci/update.sh
no_output_timeout: 20m
ci-downgrade:
steps:
- run:
command: ci/downgrade.sh
no_output_timeout: 20m
ci-apps-create:
steps:
- run:
command: ci/apps-create.sh
no_output_timeout: 20m
ci-test:
steps:
- run:
command: ci/test.sh
no_output_timeout: 50m
ci-uninstall:
steps:
- run:
command: ci/uninstall.sh
no_output_timeout: 90m