blob: da1440fd720255c6ad75e8d4d2de301ab49b165b [file] [log] [blame]
Zsolt Haraszti2a792f62016-05-12 17:49:02 -07001/*
2 * Copyright 2012 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
David K. Bainbridge59bdb542016-07-01 11:07:45 -070016import org.opencord.gradle.rules.*
David K. Bainbridge10b0c112016-05-24 13:17:23 -070017import org.yaml.snakeyaml.Yaml
Zsolt Haraszti2a792f62016-05-12 17:49:02 -070018
David K. Bainbridge59bdb542016-07-01 11:07:45 -070019allprojects {
20 apply plugin: 'base'
21 apply plugin: 'de.gesellix.docker'
22 //apply plugin: 'com.tmiyamon.config'
23
24 docker {
25 // dockerHost = System.env.DOCKER_HOST ?: 'unix:///var/run/docker.sock'
26 // dockerHost = System.env.DOCKER_HOST ?: 'https://192.168.99.100:2376'
27 // certPath = System.getProperty('docker.cert.path') ?: "${System.getProperty('user.home')}/.docker/machine/machines/default"
28 // authConfigPlain = [
29 // "username" : "joe",
30 // "password" : "some-pw-as-needed",
31 // "email" : "joe@acme.com",
32 // "serveraddress" : "https://index.docker.io/v1/"
33 // ]
34 }
35}
36
Zsolt Haraszti2a792f62016-05-12 17:49:02 -070037ext {
38
David K. Bainbridge59bdb542016-07-01 11:07:45 -070039 // Upstream registry to simplify filling out the comps table below
40 upstreamReg = project.hasProperty('upstreamReg') ? project.getProperty('upstreamReg') : 'docker.io'
41
David K. Bainbridge10b0c112016-05-24 13:17:23 -070042 // Deployment target config file (yaml format); this can be overwritten from the command line
43 // using the -PdeployConfig=<file-path> syntax.
44 deployConfig = project.hasProperty('deployConfig') ? project.getProperty('deployConfig') : './config/default.yml'
David K. Bainbridge19b8d272016-05-26 21:20:43 -070045
David K. Bainbridgec4e0fc52016-11-14 12:03:35 -080046 println "Using deployment config: $deployConfig"
47 File configFile = new File(deployConfig)
48 def yaml = new Yaml()
49 config = yaml.load(configFile.newReader())
50
51 // Target registry to be used to publish docker images needed for deployment
52 targetReg = project.hasProperty('targetReg')
53 ? project.getProperty('targetReg')
54 : config.docker && config.docker.registry
55 ? config.docker.registry
56 : 'localhost:5000'
57
58 // The tag used to tag the docker images push to the target registry
59 targetTag = project.hasProperty('targetTag')
60 ? project.getProperty('targetTag')
61 : config.docker && config.docker.imageVersion
62 ? config.docker.imageVersion
63 : 'candidate'
64
David K. Bainbridge59bdb542016-07-01 11:07:45 -070065 comps = [
66 'consul': [
67 'type': 'image',
68 'upstream': upstreamReg,
69 'name': 'consul',
70 'digest': 'sha256:0dc990ff3c44d5b5395475bcc5ebdae4fc8b67f69e17942a8b9793b3df74d290'
71 ]
72 ]
73}
74
75task fetchUpstreamImages {
76 comps.each { name, spec -> if (spec.type == 'image') { dependsOn "fetch" + name } }
Zsolt Haraszti2a792f62016-05-12 17:49:02 -070077}
78
David K. Bainbridge97ee8052016-06-14 00:52:07 -070079// Switch Configuration Image
80
David K. Bainbridgede0d9262016-09-13 20:12:06 -070081def getBuildTimestamp() {
82 def cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"))
83 def date = cal.getTime()
84 def formattedDate = date.format("yyyy-MM-dd'T'HH:mm:ss.ss'Z'")
85 return formattedDate
86}
87
88def getCommitHash = { ->
89 def hashStdOut = new ByteArrayOutputStream()
90 exec {
91 commandLine "git", "rev-parse", "HEAD"
92 standardOutput = hashStdOut
93 }
94 return hashStdOut.toString().trim()
95}
96
97def getBranchName = { ->
98 def branchStdOut = new ByteArrayOutputStream()
99 exec {
100 commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
101 standardOutput = branchStdOut
102 }
103 return branchStdOut.toString().trim()
104}
105
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700106task buildSwitchqImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700107 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', 'cord-maas-switchq', './switchq'
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700108}
109
110task tagSwitchqImage(type: Exec) {
111 dependsOn buildSwitchqImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700112 commandLine "docker", 'tag', 'cord-maas-switchq', "$targetReg/cord-maas-switchq:$targetTag"
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700113}
114
115task publishSwitchqImage(type: Exec) {
116 dependsOn tagSwitchqImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700117 commandLine "docker", 'push', "$targetReg/cord-maas-switchq:$targetTag"
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700118}
119
120// Bootstrap Image
121
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700122task buildBootstrapImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700123 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', 'cord-maas-bootstrap', './bootstrap'
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700124}
125
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700126task tagBootstrapImage(type: Exec) {
127 dependsOn buildBootstrapImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700128 commandLine "docker", 'tag', 'cord-maas-bootstrap', "$targetReg/cord-maas-bootstrap:$targetTag"
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700129}
130
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700131task publishBootstrapImage(type: Exec) {
132 dependsOn tagBootstrapImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700133 commandLine "docker", 'push', "$targetReg/cord-maas-bootstrap:$targetTag"
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700134}
135
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700136// IP Allocator Image
137
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700138task buildAllocationImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700139 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', 'cord-ip-allocator', './ip-allocator'
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700140}
141
142task tagAllocationImage(type: Exec) {
David K. Bainbridgef22dc062016-05-31 15:35:39 -0700143 dependsOn buildAllocationImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700144 commandLine "docker", 'tag', 'cord-ip-allocator', "$targetReg/cord-ip-allocator:$targetTag"
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700145}
146
147task publishAllocationImage(type: Exec) {
David K. Bainbridgef22dc062016-05-31 15:35:39 -0700148 dependsOn tagAllocationImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700149 commandLine "docker", 'push', "$targetReg/cord-ip-allocator:$targetTag"
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700150}
151
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700152// Provisioner Image
153
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700154task buildProvisionerImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700155 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', 'cord-provisioner', './provisioner'
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700156}
157
158task tagProvisionerImage(type: Exec) {
159 dependsOn buildProvisionerImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700160 commandLine "docker", 'tag', 'cord-provisioner', "$targetReg/cord-provisioner:$targetTag"
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700161}
162
163task publishProvisionerImage(type: Exec) {
164 dependsOn tagProvisionerImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700165 commandLine "docker", 'push', "$targetReg/cord-provisioner:$targetTag"
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700166}
167
gunjan5e9bdd1d2016-07-13 14:59:33 -0700168// Config Generator Image
169
170task buildConfigGeneratorImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700171 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', 'config-generator', './config-generator'
gunjan5e9bdd1d2016-07-13 14:59:33 -0700172}
173
174task tagConfigGeneratorImage(type: Exec) {
175 dependsOn buildConfigGeneratorImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700176 commandLine "docker", 'tag', 'config-generator', "$targetReg/config-generator:$targetTag"
gunjan5e9bdd1d2016-07-13 14:59:33 -0700177}
178
179task publishConfigGeneratorImage(type: Exec) {
180 dependsOn tagConfigGeneratorImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700181 commandLine "docker", 'push', "$targetReg/config-generator:$targetTag"
gunjan5e9bdd1d2016-07-13 14:59:33 -0700182}
183
David K. Bainbridge9d1e02d2016-06-22 09:22:16 -0700184// Automation Image
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700185
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700186task buildAutomationImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700187 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', "cord-maas-automation", "-f", "./automation/Dockerfile", "./automation"
David K. Bainbridgeefa951d2016-05-26 10:54:25 -0700188}
189
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700190task tagAutomationImage(type: Exec) {
191 dependsOn buildAutomationImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700192 commandLine "docker", 'tag', 'cord-maas-automation', "$targetReg/cord-maas-automation:$targetTag"
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700193}
194
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700195task publishAutomationImage(type: Exec) {
196 dependsOn tagAutomationImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700197 commandLine "docker", 'push', "$targetReg/cord-maas-automation:$targetTag"
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700198}
199
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700200// DHCP Harvester Images
201
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700202task buildHarvesterImage(type: Exec) {
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700203 commandLine "docker", 'build', '--label', 'org.label-schema.build-date=' + getBuildTimestamp(), '--label', 'org.label-schema.vcs-ref=' + getCommitHash(), '--label', 'org.label-schema.version=' + getBranchName(), '-t', "cord-dhcp-harvester", "./harvester"
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700204}
205
206task tagHarvesterImage(type: Exec) {
207 dependsOn buildHarvesterImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700208 commandLine "docker", 'tag', 'cord-dhcp-harvester', "$targetReg/cord-dhcp-harvester:$targetTag"
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700209}
210
211task publishHarvesterImage(type: Exec) {
212 dependsOn tagHarvesterImage
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700213 commandLine "docker", 'push', "$targetReg/cord-dhcp-harvester:$targetTag"
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700214}
215
216// ~~~~~~~~~~~~~~~~~~~ Global tasks ~~~~~~~~~~~~~~~~~~~~~~~
217
alshabib462f6252016-08-29 16:15:28 -0700218task updateDocker (type: Exec) {
David K. Bainbridge59bdb542016-07-01 11:07:45 -0700219 commandLine 'sudo', 'utils/enable-remote-docker-registry', "$targetReg"
220}
221
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700222// To be used to fetch upstream binaries, clone repos, etc.
223task fetch(type: Exec) {
224 // this is where we fetch upstream artifacts that we do not need internet for the build phase"
225 // Placeholdr example:
David K. Bainbridge59bdb542016-07-01 11:07:45 -0700226 dependsOn fetchUpstreamImages
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700227 commandLine "docker", "pull", "golang:alpine"
228 commandLine "docker", "pull", "python:2.7-alpine"
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700229}
230
231// To be used to generate all needed binaries that need to be present on the target
232// as docker images in the local docker runner.
233task buildImages {
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700234 dependsOn buildBootstrapImage
235 dependsOn buildHarvesterImage
David K. Bainbridge9d1e02d2016-06-22 09:22:16 -0700236 dependsOn buildAutomationImage
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700237 dependsOn buildAllocationImage
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700238 dependsOn buildProvisionerImage
gunjan5e9bdd1d2016-07-13 14:59:33 -0700239 dependsOn buildConfigGeneratorImage
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700240 dependsOn buildSwitchqImage
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700241}
242
243task tagImages {
244 dependsOn tagBootstrapImage
245 dependsOn tagHarvesterImage
David K. Bainbridge9d1e02d2016-06-22 09:22:16 -0700246 dependsOn tagAutomationImage
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700247 dependsOn tagAllocationImage
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700248 dependsOn tagProvisionerImage
gunjan5e9bdd1d2016-07-13 14:59:33 -0700249 dependsOn tagConfigGeneratorImage
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700250 dependsOn tagSwitchqImage
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700251}
252
253task publish {
alshabib462f6252016-08-29 16:15:28 -0700254 //FIXME: This works because the upstream project primes the nodes before running this.
David K. Bainbridge59bdb542016-07-01 11:07:45 -0700255 comps.each { name, spec -> if (spec.type == 'image') { dependsOn "publish" + name } }
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700256 dependsOn publishBootstrapImage
257 dependsOn publishHarvesterImage
David K. Bainbridge9d1e02d2016-06-22 09:22:16 -0700258 dependsOn publishAutomationImage
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700259 dependsOn publishAllocationImage
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700260 dependsOn publishProvisionerImage
gunjan5e9bdd1d2016-07-13 14:59:33 -0700261 dependsOn publishConfigGeneratorImage
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700262 dependsOn publishSwitchqImage
David K. Bainbridgeefa951d2016-05-26 10:54:25 -0700263}
264
David K. Bainbridge59bdb542016-07-01 11:07:45 -0700265
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700266// ~~~~~~~~~~~~~~~~~~~ Deployment / Test Tasks ~~~~~~~~~~~~~~~~~~~~~~~
267
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700268List.metaClass.asParam = { prefix, sep ->
269 if (delegate.size() == 0) {
270 ""
271 }
272 String result = "--" + prefix + "="
273 String p = ""
274 delegate.each {
275 result += p + "${it}"
276 p = sep
277 }
278 result
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700279}
280
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700281List.metaClass.p = { value, name ->
282 if (value != null && value != "") {
283 delegate << name + "=" + value
284 } else {
285 delegate
286 }
287}
288
289List.metaClass.p = { spec ->
290 if (spec != null && spec != "") {
291 delegate += spec
292 } else {
293 delegate
294 }
295}
296
alshabib462f6252016-08-29 16:15:28 -0700297task prime (type: Exec) {
David K. Bainbridgef4181702016-06-17 14:44:03 -0700298 executable = "ansible-playbook"
299 args = ["-i", config.seedServer.ip + ',']
300
301 if ( config.seedServer.user != null && config.seedServer.user != "" ) {
302 args = args << "--user=$config.seedServer.user"
303 }
304
David K. Bainbridge5ba01a92016-08-16 14:58:31 -0700305 if ( config.debug ) {
306 args = args << "-vvvv"
307 }
308
David K. Bainbridgef4181702016-06-17 14:44:03 -0700309 def extraVars = []
310 if (config.seedServer) {
311 extraVars = extraVars.p(config.seedServer.extraVars)
312 .p(config.seedServer.password, "ansible_ssh_pass")
313 .p(config.seedServer.sudoPassword, "ansible_sudo_pass")
314 .p(config.seedServer.fabric_ip, "fabric_ip")
315 .p(config.seedServer.management_ip, "management_ip")
David K. Bainbridgee80fd392016-08-19 15:46:19 -0700316 .p(config.seedServer.management_gw, "management_gw")
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700317 .p(config.seedServer.management_bc, "management_bc")
David K. Bainbridgef4181702016-06-17 14:44:03 -0700318 .p(config.seedServer.management_network, "management_network")
319 .p(config.seedServer.management_iface, "management_iface")
320 .p(config.seedServer.external_ip, "external_ip")
David K. Bainbridgee80fd392016-08-19 15:46:19 -0700321 .p(config.seedServer.external_gw, "external_gw")
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700322 .p(config.seedServer.external_bc, "external_bc")
David K. Bainbridgef4181702016-06-17 14:44:03 -0700323 .p(config.seedServer.external_network, "external_network")
324 .p(config.seedServer.external_iface, "external_iface")
David K. Bainbridgef4181702016-06-17 14:44:03 -0700325 .p(config.seedServer.fabric_iface, "fabric_iface")
326 .p(config.seedServer.domain, "domain")
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -0700327 .p(config.seedServer.virtualbox_support, "virtualbox_support")
328 .p(config.seedServer.power_helper_user, "power_helper_user")
329 .p(config.seedServer.power_helper_host, "power_helper_host")
330 .p(config.seedServer.port, "ansible_ssh_port")
David K. Bainbridgef4181702016-06-17 14:44:03 -0700331 }
332
333 if (config.otherServers) {
334 extraVars = extraVars.p(config.otherServers.location, "prov_location")
335 .p(config.otherServers.rolesPath, "prov_role_path")
336 .p(config.otherServers.role, "prov_role")
337 }
338
David K. Bainbridgec4e0fc52016-11-14 12:03:35 -0800339 extraVars = extraVars.p("$targetReg", "deploy_docker_registry")
340 .p("$targetTag", "deploy_docker_tag")
David K. Bainbridgef4181702016-06-17 14:44:03 -0700341
342 def skipTags = [].p(config.seedServer.skipTags)
343
344 args = args.p(skipTags.asParam("skip-tags", ",")).p(extraVars.asParam("extra-vars", " ")) << "prime-node.yml"
345}
346
alshabib462f6252016-08-29 16:15:28 -0700347task deployBase(type: Exec) {
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700348 executable = "ansible-playbook"
David K. Bainbridge13c765c2016-05-26 11:24:22 -0700349 args = ["-i", config.seedServer.ip + ',']
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700350
David K. Bainbridge13c765c2016-05-26 11:24:22 -0700351 if ( config.seedServer.user != null && config.seedServer.user != "" ) {
352 args = args << "--user=$config.seedServer.user"
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700353 }
354
David K. Bainbridge5ba01a92016-08-16 14:58:31 -0700355
356 if ( config.debug ) {
357 args = args << "-vvvv"
358 }
359
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700360 def extraVars = []
David K. Bainbridge13c765c2016-05-26 11:24:22 -0700361 if (config.seedServer) {
362 extraVars = extraVars.p(config.seedServer.extraVars)
363 .p(config.seedServer.password, "ansible_ssh_pass")
364 .p(config.seedServer.sudoPassword, "ansible_sudo_pass")
365 .p(config.seedServer.fabric_ip, "fabric_ip")
366 .p(config.seedServer.management_ip, "management_ip")
David K. Bainbridgee80fd392016-08-19 15:46:19 -0700367 .p(config.seedServer.management_gw, "management_gw")
David K. Bainbridgec82a4462016-06-14 12:39:01 -0700368 .p(config.seedServer.management_network, "management_network")
369 .p(config.seedServer.management_iface, "management_iface")
David K. Bainbridge13c765c2016-05-26 11:24:22 -0700370 .p(config.seedServer.external_ip, "external_ip")
David K. Bainbridgee80fd392016-08-19 15:46:19 -0700371 .p(config.seedServer.external_gw, "external_gw")
David K. Bainbridgec82a4462016-06-14 12:39:01 -0700372 .p(config.seedServer.external_network, "external_network")
373 .p(config.seedServer.external_iface, "external_iface")
David K. Bainbridgec82a4462016-06-14 12:39:01 -0700374 .p(config.seedServer.fabric_iface, "fabric_iface")
375 .p(config.seedServer.domain, "domain")
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -0700376 .p(config.seedServer.virtualbox_support, "virtualbox_support")
David K. Bainbridgec82a4462016-06-14 12:39:01 -0700377 .p(config.seedServer.power_helper_user, "power_helper_user")
378 .p(config.seedServer.power_helper_host, "power_helper_host")
David K. Bainbridgebe58a0d2016-06-22 15:43:02 -0700379 .p(config.seedServer.port, "ansible_ssh_port")
David K. Bainbridge6ea57c12016-06-06 23:29:12 -0700380 }
381
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700382 if (config.otherServers) {
383 extraVars = extraVars.p(config.otherServers.location, "prov_location")
384 .p(config.otherServers.rolesPath, "prov_role_path")
385 .p(config.otherServers.role, "prov_role")
386 }
387
David K. Bainbridgec4e0fc52016-11-14 12:03:35 -0800388 extraVars = extraVars.p("$targetReg", "deploy_docker_registry")
389 .p("$targetTag", "deploy_docker_tag")
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700390
David K. Bainbridge13c765c2016-05-26 11:24:22 -0700391 def skipTags = [].p(config.seedServer.skipTags)
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700392
393 args = args.p(skipTags.asParam("skip-tags", ",")).p(extraVars.asParam("extra-vars", " ")) << "head-node.yml"
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700394}
alshabib462f6252016-08-29 16:15:28 -0700395
396prime.dependsOn {
397 updateDocker
398}
399
400tasks.addRule(new DockerFetchRule(project))
401tasks.addRule(new DockerPublishRule(project, project(':maas').prime))
402tasks.addRule(new DockerTagRule(project))
403
404