blob: b24de644116cef53e9e1fbc544d0fb26b273b841 [file] [log] [blame]
Jonathan Hart93956f52017-08-22 13:12:42 -07001
Zsolt Haraszti2a792f62016-05-12 17:49:02 -07002/*
Jonathan Hart93956f52017-08-22 13:12:42 -07003 * Copyright 2017-present Open Networking Foundation
4
Zsolt Haraszti2a792f62016-05-12 17:49:02 -07005 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
Jonathan Hart93956f52017-08-22 13:12:42 -07008
9 * http://www.apache.org/licenses/LICENSE-2.0
10
Zsolt Haraszti2a792f62016-05-12 17:49:02 -070011 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
Jonathan Hart93956f52017-08-22 13:12:42 -070017
18
David K. Bainbridge59bdb542016-07-01 11:07:45 -070019import org.opencord.gradle.rules.*
David K. Bainbridge10b0c112016-05-24 13:17:23 -070020import org.yaml.snakeyaml.Yaml
Zsolt Haraszti2a792f62016-05-12 17:49:02 -070021
David K. Bainbridge59bdb542016-07-01 11:07:45 -070022allprojects {
23 apply plugin: 'base'
24 apply plugin: 'de.gesellix.docker'
25 //apply plugin: 'com.tmiyamon.config'
26
27 docker {
28 // dockerHost = System.env.DOCKER_HOST ?: 'unix:///var/run/docker.sock'
29 // dockerHost = System.env.DOCKER_HOST ?: 'https://192.168.99.100:2376'
30 // certPath = System.getProperty('docker.cert.path') ?: "${System.getProperty('user.home')}/.docker/machine/machines/default"
31 // authConfigPlain = [
32 // "username" : "joe",
33 // "password" : "some-pw-as-needed",
34 // "email" : "joe@acme.com",
35 // "serveraddress" : "https://index.docker.io/v1/"
36 // ]
37 }
38}
39
Zsolt Haraszti2a792f62016-05-12 17:49:02 -070040ext {
41
David K. Bainbridge59bdb542016-07-01 11:07:45 -070042 // Upstream registry to simplify filling out the comps table below
43 upstreamReg = project.hasProperty('upstreamReg') ? project.getProperty('upstreamReg') : 'docker.io'
44
David K. Bainbridge10b0c112016-05-24 13:17:23 -070045 // Deployment target config file (yaml format); this can be overwritten from the command line
46 // using the -PdeployConfig=<file-path> syntax.
47 deployConfig = project.hasProperty('deployConfig') ? project.getProperty('deployConfig') : './config/default.yml'
David K. Bainbridge19b8d272016-05-26 21:20:43 -070048
David K. Bainbridgec4e0fc52016-11-14 12:03:35 -080049 println "Using deployment config: $deployConfig"
50 File configFile = new File(deployConfig)
51 def yaml = new Yaml()
52 config = yaml.load(configFile.newReader())
53
54 // Target registry to be used to publish docker images needed for deployment
55 targetReg = project.hasProperty('targetReg')
56 ? project.getProperty('targetReg')
57 : config.docker && config.docker.registry
58 ? config.docker.registry
Zack Williamsb55e8ef2017-02-01 10:54:36 -070059 : config.headnode.ip
60 ? config.headnode.ip + ":5000"
David K. Bainbridgec9cacd32016-11-15 15:10:06 -080061 : 'localhost:5000'
David K. Bainbridgec4e0fc52016-11-14 12:03:35 -080062
63 // The tag used to tag the docker images push to the target registry
64 targetTag = project.hasProperty('targetTag')
65 ? project.getProperty('targetTag')
66 : config.docker && config.docker.imageVersion
67 ? config.docker.imageVersion
68 : 'candidate'
69
David K. Bainbridge59bdb542016-07-01 11:07:45 -070070 comps = [
71 'consul': [
72 'type': 'image',
73 'upstream': upstreamReg,
74 'name': 'consul',
75 'digest': 'sha256:0dc990ff3c44d5b5395475bcc5ebdae4fc8b67f69e17942a8b9793b3df74d290'
76 ]
77 ]
78}
79
80task fetchUpstreamImages {
81 comps.each { name, spec -> if (spec.type == 'image') { dependsOn "fetch" + name } }
Zsolt Haraszti2a792f62016-05-12 17:49:02 -070082}
83
David K. Bainbridge97ee8052016-06-14 00:52:07 -070084// Switch Configuration Image
85
David K. Bainbridgede0d9262016-09-13 20:12:06 -070086def getBuildTimestamp() {
87 def cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"))
88 def date = cal.getTime()
David K. Bainbridge151e8452016-12-19 23:05:51 -080089 def formattedDate = date.format("yyyy-MM-dd'T'HH:mm:ssZ")
David K. Bainbridgede0d9262016-09-13 20:12:06 -070090 return formattedDate
91}
92
David K. Bainbridge151e8452016-12-19 23:05:51 -080093def getCommitDate = { ->
94 def stdOut = new ByteArrayOutputStream()
95 exec {
96 commandLine "git", "log", "--pretty=format:%cd", "--date=format:%FT%T%z", "-n", "1"
97 standardOutput = stdOut
98 }
99 return stdOut.toString().trim()
100}
101
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700102def getCommitHash = { ->
103 def hashStdOut = new ByteArrayOutputStream()
104 exec {
David K. Bainbridge151e8452016-12-19 23:05:51 -0800105 commandLine "git", "log", "--pretty=format:%H", "-n", "1"
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700106 standardOutput = hashStdOut
107 }
108 return hashStdOut.toString().trim()
109}
110
David K. Bainbridged4e3f622017-01-12 14:07:54 -0800111def isModified = { ->
112 def statusOut = new ByteArrayOutputStream()
113 def branchesOut = new ByteArrayOutputStream()
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700114 exec {
David K. Bainbridged4e3f622017-01-12 14:07:54 -0800115 commandLine "bash", "-c", "repo --color=never --no-pager status . | tail -n +2 | wc -l"
116 standardOutput = statusOut
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700117 }
David K. Bainbridged4e3f622017-01-12 14:07:54 -0800118 exec {
119 commandLine "bash", "-c", "repo --color=never --no-pager branches | wc -l"
120 standardOutput = branchesOut
121 }
122 def statusVal = statusOut.toString().trim()
123 def branchesVal = branchesOut.toString().trim()
124
125 return statusVal != "0" || branchesVal != "0"
126}
127
128def getBranchName = { ->
129 def stdout = new ByteArrayOutputStream()
130 exec {
131 commandLine "bash", "-c", "repo --color=never --no-pager info -l -o | grep 'Manifest branch:' | awk '{print \$NF}'"
132 standardOutput = stdout
133 }
134 def val = stdout.toString().trim()
135 if ( isModified() != "0" ) {
136 val += '[modified]'
137 }
138 return val
David K. Bainbridgede0d9262016-09-13 20:12:06 -0700139}
David K. Bainbridge6e23ac82016-12-07 12:55:41 -0800140
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700141task buildSwitchqImage(type: Exec) {
David K. Bainbridge528b3182017-01-23 08:51:59 -0800142 workingDir 'switchq'
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -0700143 commandLine 'make', "DOCKER_TAG=$targetTag", "DOCKER_REGISTRY=$targetReg", 'build'
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700144}
145
146task publishSwitchqImage(type: Exec) {
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -0700147 workingDir 'switchq'
148 commandLine 'make', "DOCKER_TAG=$targetTag", "DOCKER_REGISTRY=$targetReg", 'publish'
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700149}
150
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700151// IP Allocator Image
152
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700153task buildAllocationImage(type: Exec) {
David K. Bainbridge528b3182017-01-23 08:51:59 -0800154 workingDir 'ip-allocator'
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -0700155 commandLine 'make', "DOCKER_TAG=$targetTag", "DOCKER_REGISTRY=$targetReg", 'build'
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700156}
157
158task publishAllocationImage(type: Exec) {
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -0700159 workingDir 'ip-allocator'
160 commandLine 'make', "DOCKER_TAG=$targetTag", "DOCKER_REGISTRY=$targetReg", 'publish'
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700161}
162
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700163// Provisioner Image
164
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700165task buildProvisionerImage(type: Exec) {
David K. Bainbridge528b3182017-01-23 08:51:59 -0800166 workingDir 'provisioner'
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -0700167 commandLine 'make', "DOCKER_TAG=$targetTag", "DOCKER_REGISTRY=$targetReg", 'build'
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700168}
169
170task publishProvisionerImage(type: Exec) {
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -0700171 workingDir 'provisioner'
172 commandLine 'make', "DOCKER_TAG=$targetTag", "DOCKER_REGISTRY=$targetReg", 'publish'
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700173}
174
gunjan5e9bdd1d2016-07-13 14:59:33 -0700175// Config Generator Image
176
177task buildConfigGeneratorImage(type: Exec) {
David K. Bainbridge528b3182017-01-23 08:51:59 -0800178 workingDir 'config-generator'
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -0700179 commandLine 'make', "DOCKER_TAG=$targetTag", "DOCKER_REGISTRY=$targetReg", 'build'
gunjan5e9bdd1d2016-07-13 14:59:33 -0700180}
181
182task publishConfigGeneratorImage(type: Exec) {
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -0700183 workingDir 'config-generator'
184 commandLine 'make', "DOCKER_TAG=$targetTag", "DOCKER_REGISTRY=$targetReg", 'publish'
gunjan5e9bdd1d2016-07-13 14:59:33 -0700185}
186
David K. Bainbridge9d1e02d2016-06-22 09:22:16 -0700187// Automation Image
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700188
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700189task buildAutomationImage(type: Exec) {
David K. Bainbridge528b3182017-01-23 08:51:59 -0800190 workingDir 'automation'
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -0700191 commandLine 'make', "DOCKER_TAG=$targetTag", "DOCKER_REGISTRY=$targetReg", 'build'
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700192}
193
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700194task publishAutomationImage(type: Exec) {
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -0700195 workingDir 'automation'
196 commandLine 'make', "DOCKER_TAG=$targetTag", "DOCKER_REGISTRY=$targetReg", 'publish'
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700197}
198
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700199// DHCP Harvester Images
200
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700201task buildHarvesterImage(type: Exec) {
David K. Bainbridge528b3182017-01-23 08:51:59 -0800202 workingDir 'harvester'
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -0700203 commandLine 'make', "DOCKER_TAG=$targetTag", "DOCKER_REGISTRY=$targetReg", 'build'
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700204}
205
206task publishHarvesterImage(type: Exec) {
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -0700207 workingDir 'harvester'
208 commandLine 'make', "DOCKER_TAG=$targetTag", "DOCKER_REGISTRY=$targetReg", 'publish'
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700209}
210
211// ~~~~~~~~~~~~~~~~~~~ Global tasks ~~~~~~~~~~~~~~~~~~~~~~~
212
alshabib462f6252016-08-29 16:15:28 -0700213task updateDocker (type: Exec) {
David K. Bainbridge59bdb542016-07-01 11:07:45 -0700214 commandLine 'sudo', 'utils/enable-remote-docker-registry', "$targetReg"
215}
216
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700217// To be used to fetch upstream binaries, clone repos, etc.
218task fetch(type: Exec) {
219 // this is where we fetch upstream artifacts that we do not need internet for the build phase"
220 // Placeholdr example:
David K. Bainbridge59bdb542016-07-01 11:07:45 -0700221 dependsOn fetchUpstreamImages
David K. Bainbridgea677d4e2016-09-11 20:01:32 -0700222 commandLine "docker", "pull", "golang:alpine"
223 commandLine "docker", "pull", "python:2.7-alpine"
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700224}
225
226// To be used to generate all needed binaries that need to be present on the target
227// as docker images in the local docker runner.
228task buildImages {
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700229 dependsOn buildHarvesterImage
David K. Bainbridge9d1e02d2016-06-22 09:22:16 -0700230 dependsOn buildAutomationImage
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700231 dependsOn buildAllocationImage
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700232 dependsOn buildProvisionerImage
gunjan5e9bdd1d2016-07-13 14:59:33 -0700233 dependsOn buildConfigGeneratorImage
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700234 dependsOn buildSwitchqImage
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700235}
236
Zsolt Haraszti2a792f62016-05-12 17:49:02 -0700237task publish {
alshabib462f6252016-08-29 16:15:28 -0700238 //FIXME: This works because the upstream project primes the nodes before running this.
David K. Bainbridge59bdb542016-07-01 11:07:45 -0700239 comps.each { name, spec -> if (spec.type == 'image') { dependsOn "publish" + name } }
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700240 dependsOn publishHarvesterImage
David K. Bainbridge9d1e02d2016-06-22 09:22:16 -0700241 dependsOn publishAutomationImage
David K. Bainbridge8bc905c2016-05-31 14:07:10 -0700242 dependsOn publishAllocationImage
David K. Bainbridgef0da8732016-06-01 16:15:37 -0700243 dependsOn publishProvisionerImage
gunjan5e9bdd1d2016-07-13 14:59:33 -0700244 dependsOn publishConfigGeneratorImage
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700245 dependsOn publishSwitchqImage
David K. Bainbridgeefa951d2016-05-26 10:54:25 -0700246}
247
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700248// ~~~~~~~~~~~~~~~~~~~ Deployment / Test Tasks ~~~~~~~~~~~~~~~~~~~~~~~
249
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700250List.metaClass.asParam = { prefix, sep ->
251 if (delegate.size() == 0) {
252 ""
253 }
254 String result = "--" + prefix + "="
255 String p = ""
256 delegate.each {
257 result += p + "${it}"
258 p = sep
259 }
260 result
David K. Bainbridgeb5415042016-05-13 17:06:10 -0700261}
262
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700263List.metaClass.p = { value, name ->
264 if (value != null && value != "") {
265 delegate << name + "=" + value
266 } else {
267 delegate
268 }
269}
270
271List.metaClass.p = { spec ->
272 if (spec != null && spec != "") {
273 delegate += spec
274 } else {
275 delegate
276 }
277}
278
alshabib462f6252016-08-29 16:15:28 -0700279task prime (type: Exec) {
David K. Bainbridgef4181702016-06-17 14:44:03 -0700280 executable = "ansible-playbook"
Zack Williams642388d2017-04-12 22:39:15 -0700281 args = ["-i", '../genconfig/cord-inv']
David K. Bainbridgef4181702016-06-17 14:44:03 -0700282
Zack Williamsb55e8ef2017-02-01 10:54:36 -0700283 if ( config.headnode.ansible_user != null && config.headnode.ansible_user != "" ) {
284 args = args << "--user=$config.headnode.ansible_user"
David K. Bainbridgef4181702016-06-17 14:44:03 -0700285 }
286
David K. Bainbridge5ba01a92016-08-16 14:58:31 -0700287 if ( config.debug ) {
288 args = args << "-vvvv"
289 }
290
David K. Bainbridgef4181702016-06-17 14:44:03 -0700291 def extraVars = []
Zack Williamsb55e8ef2017-02-01 10:54:36 -0700292 if (config.common) {
293 extraVars = extraVars.p(config.common.extraVars)
294 .p(config.headnode.ansible_ssh_pass, "ansible_ssh_pass")
295 .p(config.headnode.ansible_become_pass, "ansible_become_pass")
296 .p(config.headnode.ansible_ssh_port, "ansible_ssh_port")
297 .p(config.common.fabric_ip, "fabric_ip")
298 .p(config.common.fabric_range_low, "fabric_range_low")
299 .p(config.common.fabric_range_high, "fabric_range_high")
300 .p(config.common.management_ip, "management_ip")
301 .p(config.common.management_range_low, "management_range_low")
302 .p(config.common.management_range_high, "management_range_high")
303 .p(config.common.management_gw, "management_gw")
304 .p(config.common.management_bc, "management_bc")
305 .p(config.common.management_network, "management_network")
306 .p(config.common.management_iface, "management_iface")
307 .p(config.common.external_ip, "external_ip")
308 .p(config.common.external_gw, "external_gw")
309 .p(config.common.external_bc, "external_bc")
310 .p(config.common.external_network, "external_network")
311 .p(config.common.external_iface, "external_iface")
312 .p(config.common.fabric_iface, "fabric_iface")
313 .p(config.common.domain, "domain")
314 .p(config.common.virtualbox_support, "virtualbox_support")
315 .p(config.common.power_helper_user, "power_helper_user")
316 .p(config.common.power_helper_host, "power_helper_host")
saikrishna edupugantie86ddab2017-07-23 21:04:06 -0700317 .p(config.common.kernel_opts, "kernel_opts")
David K. Bainbridgef4181702016-06-17 14:44:03 -0700318 }
319
David K. Bainbridge8b179042016-11-30 15:38:42 -0800320 if (config.passwords) {
321 extraVars = extraVars.p(config.passwords.compute_node, "password_compute_node")
322 .p(config.passwords.maas_admin, "password_maas_admin")
323 .p(config.passwords.maas_user, "password_maas_user")
324 }
325
David K. Bainbridgef4181702016-06-17 14:44:03 -0700326 if (config.otherServers) {
327 extraVars = extraVars.p(config.otherServers.location, "prov_location")
328 .p(config.otherServers.rolesPath, "prov_role_path")
329 .p(config.otherServers.role, "prov_role")
330 }
331
David K. Bainbridgec4e0fc52016-11-14 12:03:35 -0800332 extraVars = extraVars.p("$targetReg", "deploy_docker_registry")
333 .p("$targetTag", "deploy_docker_tag")
David K. Bainbridgef4181702016-06-17 14:44:03 -0700334
David K. Bainbridge6e23ac82016-12-07 12:55:41 -0800335 // the password set on the compute node is skipped because this is being run against the
336 // head node and we don't want to change the head node password as this node was manualy
David K. Bainbridge8b179042016-11-30 15:38:42 -0800337 // set up.
Zack Williamsb55e8ef2017-02-01 10:54:36 -0700338 def skipTags = [].p(config.common.skipTags).p('set_compute_node_password')
David K. Bainbridgef4181702016-06-17 14:44:03 -0700339
340 args = args.p(skipTags.asParam("skip-tags", ",")).p(extraVars.asParam("extra-vars", " ")) << "prime-node.yml"
341}
342
alshabib462f6252016-08-29 16:15:28 -0700343task deployBase(type: Exec) {
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700344 executable = "ansible-playbook"
Zack Williams642388d2017-04-12 22:39:15 -0700345 args = ["-i", '../genconfig/cord-inv']
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700346
Zack Williamsb55e8ef2017-02-01 10:54:36 -0700347 if ( config.headnode.ansible_user != null && config.headnode.ansible_user != "" ) {
348 args = args << "--user=$config.headnode.ansible_user"
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700349 }
350
David K. Bainbridge5ba01a92016-08-16 14:58:31 -0700351 if ( config.debug ) {
352 args = args << "-vvvv"
353 }
354
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700355 def extraVars = []
Zack Williamsb55e8ef2017-02-01 10:54:36 -0700356 if (config.common) {
357 extraVars = extraVars.p(config.common.extraVars)
358 .p(config.headnode.ansible_ssh_pass, "ansible_ssh_pass")
359 .p(config.headnode.ansible_become_pass, "ansible_become_pass")
360 .p(config.headnode.ansible_ssh_port, "ansible_ssh_port")
361 .p(config.common.fabric_ip, "fabric_ip")
362 .p(config.common.fabric_range_low, "fabric_range_low")
363 .p(config.common.fabric_range_high, "fabric_range_high")
364 .p(config.common.management_ip, "management_ip")
365 .p(config.common.management_range_low, "management_range_low")
366 .p(config.common.management_range_high, "management_range_high")
367 .p(config.common.management_gw, "management_gw")
368 .p(config.common.management_network, "management_network")
369 .p(config.common.management_iface, "management_iface")
370 .p(config.common.external_ip, "external_ip")
371 .p(config.common.external_gw, "external_gw")
372 .p(config.common.external_network, "external_network")
373 .p(config.common.external_iface, "external_iface")
374 .p(config.common.fabric_iface, "fabric_iface")
375 .p(config.common.domain, "domain")
376 .p(config.common.virtualbox_support, "virtualbox_support")
377 .p(config.common.power_helper_user, "power_helper_user")
378 .p(config.common.power_helper_host, "power_helper_host")
saikrishna edupugantie86ddab2017-07-23 21:04:06 -0700379 .p(config.common.kernel_opts, "kernel_opts")
David K. Bainbridge6ea57c12016-06-06 23:29:12 -0700380 }
381
David K. Bainbridge8b179042016-11-30 15:38:42 -0800382 if (config.passwords) {
383 extraVars = extraVars.p(config.passwords.compute_node, "password_compute_node")
384 .p(config.passwords.maas_admin, "password_maas_admin")
385 .p(config.passwords.maas_user, "password_maas_user")
386 }
387
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700388 if (config.otherServers) {
389 extraVars = extraVars.p(config.otherServers.location, "prov_location")
390 .p(config.otherServers.rolesPath, "prov_role_path")
391 .p(config.otherServers.role, "prov_role")
392 }
393
David K. Bainbridgec4e0fc52016-11-14 12:03:35 -0800394 extraVars = extraVars.p("$targetReg", "deploy_docker_registry")
395 .p("$targetTag", "deploy_docker_tag")
David K. Bainbridge97ee8052016-06-14 00:52:07 -0700396
David K. Bainbridge8b179042016-11-30 15:38:42 -0800397 // the password set on the compute node is skipped because this is being run against the
398 // head node and we don't want to change the head node password as this node was manualy
399 // set up.
Zack Williamsb55e8ef2017-02-01 10:54:36 -0700400 def skipTags = [].p(config.common.skipTags).p('set_compute_node_password')
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700401
402 args = args.p(skipTags.asParam("skip-tags", ",")).p(extraVars.asParam("extra-vars", " ")) << "head-node.yml"
David K. Bainbridge10b0c112016-05-24 13:17:23 -0700403}
alshabib462f6252016-08-29 16:15:28 -0700404
405prime.dependsOn {
406 updateDocker
407}
408
409tasks.addRule(new DockerFetchRule(project))
410tasks.addRule(new DockerPublishRule(project, project(':maas').prime))
411tasks.addRule(new DockerTagRule(project))
412
413