-
Notifications
You must be signed in to change notification settings - Fork 28
/
recycle.yml
82 lines (74 loc) · 1.89 KB
/
recycle.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
<%
pools = %w(gcp azure aws vsphere vsphere-proxy)
%>
resource_types:
- name: pool-trigger
type: docker-image
source:
repository: cfmobile/pool-trigger
- name: pool
type: docker-image
source:
repository: concourse/pool-resource
tag: '1.1.3'
resources:
- name: git-kubo-ci
type: git
source:
uri: https://github.com/cloudfoundry-incubator/kubo-ci
branch: master
<% pools.each do |pool| %>
- name: <%= pool %>-lifecycle-trigger
type: pool-trigger
source:
uri: [email protected]:pivotal-cf-experimental/kubo-locks.git
branch: master
pool: <%= pool %>-lifecycle
private_key: ((git-ssh-key.private_key))
- name: <%= pool %>-lifecycle
type: pool
source:
uri: [email protected]:pivotal-cf-experimental/kubo-locks.git
branch: master
private_key: ((git-ssh-key.private_key))
pool: <%= pool %>-lifecycle
- name: <%= pool %>-pool
type: pool
source:
uri: [email protected]:pivotal-cf-experimental/kubo-locks.git
branch: master
private_key: ((git-ssh-key.private_key))
pool: <%= pool %>
<% end %>
jobs:
<% pools.each do |pool| %>
- name: claim-lock-<%= pool %>
plan:
- get: <%= pool %>-lifecycle-trigger
trigger: true
version: every
- put: <%= pool %>-lifecycle
params: { acquire: true }
- name: cleanup-<%= pool %>
plan:
- in_parallel:
- get: <%= pool %>-lifecycle
passed: [ claim-lock-<%= pool %> ]
version: every
trigger: true
- get: git-kubo-ci
- task: destroy-k8s
file: git-kubo-ci/tasks/destroy-k8s-instance-long-lived-director.yml
input_mapping:
kubo-lock: <%= pool %>-lifecycle
<% if pool == 'vsphere' %>
tags: [ 'vsphere-lb' ]
<% end %>
<% if pool == 'vsphere-proxy' %>
tags: [ 'vsphere-proxy' ]
<% end %>
- put: <%= pool %>-pool
params: { add: <%= pool %>-lifecycle }
- put: <%= pool %>-lifecycle
params: { remove: <%= pool %>-lifecycle }
<% end %>