-
Notifications
You must be signed in to change notification settings - Fork 18
/
config.yml
77 lines (76 loc) · 1.99 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
default-machine: &default-machine
machine:
image: ubuntu-2204:current
docker_layer_caching: true
resource_class: arm.large
version: 2.1
parameters:
workflow:
type: enum
default: test
description: The workflow to trigger.
enum: [test, deploy]
commands:
devcontainer-install:
steps:
- run: npm install -g @devcontainers/cli
devcontainer-build:
steps:
- run: devcontainer build --workspace-folder .
devcontainer-up:
steps:
- run: devcontainer up --workspace-folder .
- run: devcontainer run-user-commands --workspace-folder .
devcontainer-run:
parameters:
cmd: { type: string }
args: { type: string, default: "" }
options: { type: string, default: "" }
steps:
- run: >
devcontainer exec
--workspace-folder .
<< parameters.options >>
<< parameters.cmd >>
<< parameters.args >>
jobs:
devcontainer:
<<: *default-machine
steps:
- checkout
- devcontainer-install
- devcontainer-build
test-job:
<<: *default-machine
steps:
- checkout
- devcontainer-install
- devcontainer-up
- devcontainer-run: { cmd: ./bin/setup }
- devcontainer-run: { cmd: ./bin/test }
deploy-job:
<<: *default-machine
steps:
- checkout
- devcontainer-install
- devcontainer-up
- devcontainer-run:
options: >-
--remote-env AWS_REGION=us-east-1
--remote-env AWS_DEFAULT_REGION=us-east-1
--remote-env AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
--remote-env AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
cmd: ./bin/deploy
workflows:
test:
when: { equal: [ test, << pipeline.parameters.workflow >> ] }
jobs:
- devcontainer
- test-job:
requires: [devcontainer]
deploy:
when: { equal: [ deploy, << pipeline.parameters.workflow >> ] }
jobs:
- devcontainer
- deploy-job:
requires: [devcontainer]