Skip to content

Instantly share code, notes, and snippets.

@bencao
Last active March 21, 2019 15:52
Show Gist options
  • Save bencao/f3ea0c490d1733cd5cf67c38d3550451 to your computer and use it in GitHub Desktop.
Save bencao/f3ea0c490d1733cd5cf67c38d3550451 to your computer and use it in GitHub Desktop.
concourse capacity pattern
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
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