-
Notifications
You must be signed in to change notification settings - Fork 75
/
@orb.yml
142 lines (127 loc) · 5.69 KB
/
@orb.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
version: 2.1
description: |
Allows jobs or entire workflows to be queued to ensure they run in serial.
This is ideal for deployments or other activities that must not run concurrently.
May optionaly consider branch-level isolation if unique branches should run concurrently.
This orb requires the project to have an **Personal** API key in order to query build states.
It requires a single environment variable CIRCLECI_API_KEY which can be created in account settings - https://circleci.com/account/api.
3.2.1: Docs improvement, PR #136 Thanks @RainOfTerra
3.2.0: Adds back-off support to handle 429 throttling from new API. PR #134 Thanks @rainofterra
3.1.6: Fix #128 again, this time on JQ side. PR #133 Thanks @RainOfTerra
3.1.5: Fix #128: allow spaces in job names and other bash bugs in PR #131, thanks @RainOfTerra
3.1.4: Fix missing branch error when using tags. Issue #126
3.1.2: Fix github VCS switch (API calls failing) thanks @risinga PR #122
3.1.1: Boolean fix finally isolated, thanks @@charlescqian
3.1.0: Force fail, not cancel, when blocked. PR #113, thanks @pguinard-public-com
3.0.0: [BREAKING CHANGE] Use pipeline.number as authoritative comparison. Deep thanks to @PChambino
2.2.2: Docs clarity on token needs (@davidjb)
2.2.1: fixes release version bug
2.2.0: Adds 'filter-by-workflow' (@soniqua)
2.0.0: Breaking change fixes dyanamic config, but may break Bitbucket users.
1.12.0: Adds Server Support (@nanophate)
1.9.0: Doc update
1.8.4: Adds urlencode for branch names. (@andrew-barnett)
1.8.1: Adds content-type header to API calls (@kevinr-electric) and prints message on error (@AlexMeuer)
1.8.0: minor fix same as version 1.8.0 (missing docs)
1.7.1: patch fix same as version 1.8.1 to catch folsk who dont update
1.7.0: adds regexp for job names, collab with @jonesie100
1.6.5: docs contribution by @pwilczynskiclearcode
1.6.4: support slashes in Tags, thanks @dunial
1.6.3: addresses API changes that broke branch-job queueing, adds more API checks
1.6.1: fixes issue in tag matching , thanks @calvin-summer
1.6.0: Support Tags, thanks @nikolaik, @dunial
1.5.0: API variables name as parameter , thanks @philnielson
1.4.4: Docs improvements, thanks @jordan-brough
1.4.3: more confident confidence thanks @GreshamDanielStephens
1.4.2: Doc improvements, thanks @olleolleolle
1.4.1: fixes bug in block-workflow as job. thanks @mu-bro
1.4.0: Adds confidence checks to avoid race condition
1.3.0: use small resource class in job
display:
home_url: https://eddiewebb.github.io/circleci-queue/
source_url: https://github.com/eddiewebb/circleci-queue
examples:
queue_workflow:
description: Used typically as first job and will queue until no previous workflows are running
usage:
version: 2.1
orbs:
queue: eddiewebb/queue@volatile
workflows:
build_deploy:
jobs:
- queue/block_workflow:
my-pipeline: <<pipeline.number>> # Required due to orb processing flow
max-wait-time: "10" # max wait, in minutes (default 10)
limit-branch-name: main # restrict queueing to a specific branch (default *)
- some_other_job:
requires:
- queue/block_workflow
single_concurrency_job:
description: |
Used to ensure that a only single job (deploy) is not run concurrently.
By default will only queue if the same job from previous worfklows is running on the same branch.
This allows safe jobs like build/test to overlap, minimizing overall queue times.
usage:
version: 2.1
orbs:
queue: eddiewebb/queue@volatile
workflows:
build_deploy:
jobs:
- build
- deploy:
requires:
- build
jobs:
build:
docker:
- image: circleci/node:10
steps:
- run: echo "This job can overlap"
deploy:
docker:
- image: circleci/node:10
steps:
- queue/until_front_of_line:
my-pipeline: <<pipeline.number>> # Required due to orb processing flow
max-wait-time: "10" # max wait, in minutes (default 10)
limit-branch-name: main # restrict queueing to a specific branch (default *)
- run: echo "This job will not overlap"
multiple_job_names_regexp:
description: Use regexp-jobname when you have multiple jobs to block order of.
usage:
version: 2.1
orbs:
queue: eddiewebb/queue@volatile
workflows:
build_deploy:
jobs:
- build
- DeployStep1:
requires:
- build
- DeployStep2:
requires:
- DeployStep1
jobs:
build:
docker:
- image: circleci/node:10
steps:
- run: echo "This job can overlap"
DeployStep1:
docker:
- image: circleci/node:10
steps:
- queue/until_front_of_line:
my-pipeline: <<pipeline.number>> # Required due to orb processing flow
max-wait-time: "10" # max wait, in minutes (default 10)
limit-branch-name: main # restrict queueing to a specific branch (default *)
job-regex: "^DeployStep[0-9]$" #use extendex regexp pattern
- run: echo "This job will not overlap with itself or next similar nameds job"
DeployStep2:
docker:
- image: circleci/node:10
steps:
- run: echo "This job will block step1 on any further workflows"