Last active
March 21, 2019 15:52
-
-
Save bencao/f3ea0c490d1733cd5cf67c38d3550451 to your computer and use it in GitHub Desktop.
concourse capacity pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git repo should have structure similar to this. those capacity numbers are just empty files which represent a single capacity unit. | |
├── capacity | |
│ ├── claimed | |
│ │ └── 2 | |
│ └── unclaimed | |
│ ├── 1 | |
│ ├── 3 | |
│ ├── 4 | |
│ ├── 5 | |
│ ├── 6 | |
│ ├── 7 | |
│ └── 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources: | |
- name: capacity | |
type: pool | |
source: | |
uri: <git-url> | |
pool: capacity # please see the above capacity repo note for details setting up a proper repo as pool | |
branch: master | |
private_key: ((git-private-key)) | |
jobs: | |
- name: a-heavy-job | |
plan: | |
- put: capacity | |
attempts: 2 # recommend to have multiple attempts, since sometimes checkout resource will timeout | |
params: { acquire: true } | |
- task: a-heavy-task | |
config: .... | |
ensure: | |
put: capacity | |
params: { release: capacity } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment