forked from jithine/workflow-parallel-join-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscrewdriver.yaml
72 lines (71 loc) · 2.04 KB
/
screwdriver.yaml
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
annotations:
screwdriver.cd/chainPR: true
jobs:
main-pr:
requires: [~pr]
image: node:12
steps:
- echo: echo
build-pr1:
requires: [main-pr]
image: node:12
steps:
- echo: echo
build-pr2:
requires: [main-pr]
image: node:12
steps:
- echo: echo
join-pr:
requires: [build-pr1, build-pr2]
image: node:12
steps:
- echo: echo
main:
requires: [~commit, ~pr]
image: node:12
steps:
- echo: echo
build-node8:
image: node:8
steps:
- init: npm install
- test: npm test
- publish: |
echo "publishing against node 8"
meta set publish.node8 `date +%s`
sleep 1
requires: [main]
# B and C will run in parallel
build-node10:
image: node:10
steps:
- init: npm install
- test: npm test
- publish: |
echo "publishing against node 10"
meta set publish.node10 `date +%s`
sleep 3
requires: [main]
delploy-stage:
image: node:10
steps:
- verify: echo verify
- deploy-8: echo "deploying node8 $(meta get publish.node8)"
- deploy-10: echo "deploying node10 $(meta get publish.node10)"
requires: [build-node10, build-node8, sd@1:main-2]
delploy-prod:
image: node:10
steps:
- verify: echo verify
- deploy-8: echo "deploying node8 $(meta get publish.node8)"
- deploy-10: echo "deploying node10 $(meta get publish.node10)"
requires: [delploy-stage]
rollback-prod:
image: node:10
requires: [~sd@1:main]
steps:
- rollback-8: |
echo "rolling back to version $(meta get publish.node8)"
- rollback-10: |
echo "rolling back to version $(meta get publish.node10)"