Matteo Scandolo | 60b640f | 2017-08-08 13:05:22 -0700 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2017-present Open Networking Foundation |
| 4 | |
| 5 | * 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 |
| 8 | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | * 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 | */ |
| 17 | |
| 18 | |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 19 | /* |
| 20 | * Copyright 2012 the original author or authors. |
| 21 | * |
| 22 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 23 | * you may not use this file except in compliance with the License. |
| 24 | * You may obtain a copy of the License at |
| 25 | * |
| 26 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 27 | * |
| 28 | * Unless required by applicable law or agreed to in writing, software |
| 29 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 30 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 31 | * See the License for the specific language governing permissions and |
| 32 | * limitations under the License. |
| 33 | */ |
| 34 | |
Zsolt Haraszti | 0b790aa | 2016-05-12 22:33:14 -0700 | [diff] [blame] | 35 | import org.opencord.gradle.rules.* |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 36 | import org.yaml.snakeyaml.Yaml |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 37 | import org.yaml.snakeyaml.DumperOptions |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 38 | |
alshabib | 11b8e5c | 2016-08-29 15:36:36 -0700 | [diff] [blame] | 39 | buildscript { |
| 40 | repositories { |
| 41 | maven { |
| 42 | url "https://plugins.gradle.org/m2/" |
| 43 | } |
| 44 | } |
| 45 | dependencies { |
| 46 | classpath "gradle.plugin.com.dorongold.plugins:task-tree:1.2.1" |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | apply plugin: "com.dorongold.task-tree" |
| 51 | |
| 52 | evaluationDependsOn(':maas') |
alshabib | 11b8e5c | 2016-08-29 15:36:36 -0700 | [diff] [blame] | 53 | evaluationDependsOn(':onos-apps') |
Andy Bavier | 96df5e6 | 2017-03-13 18:19:24 -0400 | [diff] [blame] | 54 | evaluationDependsOn(':orchestration:xos') |
Scott Baker | a6e5dd1 | 2017-04-17 10:08:16 -0700 | [diff] [blame] | 55 | evaluationDependsOn(':platform-install') |
alshabib | 11b8e5c | 2016-08-29 15:36:36 -0700 | [diff] [blame] | 56 | |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 57 | allprojects { |
| 58 | apply plugin: 'base' |
| 59 | apply plugin: 'de.gesellix.docker' |
| 60 | //apply plugin: 'com.tmiyamon.config' |
| 61 | |
| 62 | docker { |
| 63 | // dockerHost = System.env.DOCKER_HOST ?: 'unix:///var/run/docker.sock' |
| 64 | // dockerHost = System.env.DOCKER_HOST ?: 'https://192.168.99.100:2376' |
| 65 | // certPath = System.getProperty('docker.cert.path') ?: "${System.getProperty('user.home')}/.docker/machine/machines/default" |
| 66 | // authConfigPlain = [ |
| 67 | // "username" : "joe", |
| 68 | // "password" : "some-pw-as-needed", |
| 69 | // "email" : "joe@acme.com", |
| 70 | // "serveraddress" : "https://index.docker.io/v1/" |
| 71 | // ] |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | ext { |
| 76 | |
David K. Bainbridge | 094508e | 2016-11-15 17:23:51 -0800 | [diff] [blame] | 77 | // Deployment target config file (yaml format); this can be overwritten from the command line |
| 78 | // using the -PdeployConfig=<file-path> syntax. |
alshabib | 19c61df | 2017-02-14 11:25:22 -0800 | [diff] [blame] | 79 | deployConfig = project.hasProperty('deployConfig') ? project.getProperty('deployConfig') : './config/default.yml' |
David K. Bainbridge | 094508e | 2016-11-15 17:23:51 -0800 | [diff] [blame] | 80 | |
| 81 | println "Using deployment config: $deployConfig" |
| 82 | File configFile = new File(deployConfig) |
| 83 | def yaml = new Yaml() |
| 84 | config = yaml.load(configFile.newReader()) |
| 85 | |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 86 | // Upstream registry to simplify filling out the comps table below |
Zsolt Haraszti | a9f7250 | 2016-05-12 16:07:03 -0700 | [diff] [blame] | 87 | upstreamReg = project.hasProperty('upstreamReg') ? project.getProperty('upstreamReg') : 'docker.io' |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 88 | |
| 89 | // Target registry to be used to publish docker images needed for deployment |
David K. Bainbridge | 094508e | 2016-11-15 17:23:51 -0800 | [diff] [blame] | 90 | targetReg = project.hasProperty('targetReg') |
| 91 | ? project.getProperty('targetReg') |
| 92 | : config.docker && config.docker.registry |
| 93 | ? config.docker.registry |
Zack Williams | 0620c93 | 2017-01-25 14:36:31 -0700 | [diff] [blame] | 94 | : config.headnode.ip |
| 95 | ? config.headnode.ip + ":5000" |
David K. Bainbridge | 094508e | 2016-11-15 17:23:51 -0800 | [diff] [blame] | 96 | : 'localhost:5000' |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 97 | |
| 98 | // The tag used to tag the docker images push to the target registry |
David K. Bainbridge | 094508e | 2016-11-15 17:23:51 -0800 | [diff] [blame] | 99 | targetTag = project.hasProperty('targetTag') |
| 100 | ? project.getProperty('targetTag') |
| 101 | : config.docker && config.docker.imageVersion |
| 102 | ? config.docker.imageVersion |
| 103 | : 'candidate' |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 104 | |
| 105 | // Component table |
| 106 | comps = [ |
Jonathan Hart | 0e8d8bb | 2017-09-12 16:45:58 -0700 | [diff] [blame] | 107 | // ONOS 1.10.6 |
Andy Bavier | b69496a | 2017-05-10 14:42:38 -0400 | [diff] [blame] | 108 | 'onosproject/onos': [ |
David K. Bainbridge | d54ca70 | 2016-07-13 22:27:12 -0700 | [diff] [blame] | 109 | 'type': 'image', |
| 110 | 'upstream': upstreamReg, |
Andy Bavier | b69496a | 2017-05-10 14:42:38 -0400 | [diff] [blame] | 111 | 'name': 'onosproject/onos', |
Jonathan Hart | 0e8d8bb | 2017-09-12 16:45:58 -0700 | [diff] [blame] | 112 | 'digest': 'sha256:b239993ad921f41ca9ab5dce21d7f6f0f8a74fdb888fe14c0da337202f9dced7' |
David K. Bainbridge | d54ca70 | 2016-07-13 22:27:12 -0700 | [diff] [blame] | 113 | ], |
Zsolt Haraszti | 3dbe616 | 2016-05-12 12:25:56 -0700 | [diff] [blame] | 114 | 'nginx': [ |
| 115 | 'type': 'image', |
| 116 | 'upstream': upstreamReg, |
| 117 | 'name': 'nginx', |
| 118 | 'digest': 'sha256:b555f8c64ab4e85405e0d8b03f759b73ce88deb802892a3b155ef55e3e832806' |
| 119 | ], |
| 120 | 'swarm': [ |
| 121 | 'type': 'image', |
| 122 | 'upstream': upstreamReg, |
| 123 | 'name': 'swarm', |
| 124 | 'digest': 'sha256:6ca9b40980e2fcdcd229900ec8933f3e92c14ead22c9404cb09736cb4f3a9248' |
| 125 | ], |
Scott Baker | a0a0e44 | 2016-10-10 20:58:22 -0700 | [diff] [blame] | 126 | 'xosproject/vsg': [ |
| 127 | 'type': 'image', |
| 128 | 'upstream': upstreamReg, |
| 129 | 'name': 'xosproject/vsg', |
| 130 | 'digest': 'sha256:18d1c6ef9767d8a41c9b51948776052d024d4e3294e5d1d6dde1a49112175d91' |
| 131 | ], |
Scott Baker | bceca9c | 2016-11-05 18:59:25 -0700 | [diff] [blame] | 132 | 'redis': [ |
| 133 | 'type': 'image', |
| 134 | 'upstream': upstreamReg, |
| 135 | 'name': 'redis', |
| 136 | 'digest': 'sha256:0fe5a7afa2c2154f37c8ab56a9a6c5023cb0405cc0e85b34d8dcc1de6c3f143e' |
| 137 | ], |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 138 | // Node 7.9.0 |
Scott Baker | 18ea0c3 | 2017-01-19 09:29:57 -0800 | [diff] [blame] | 139 | 'node': [ |
| 140 | 'type': 'image', |
| 141 | 'upstream': upstreamReg, |
| 142 | 'name': 'node', |
Andy Bavier | 35d238e | 2017-07-24 16:47:22 -0700 | [diff] [blame] | 143 | 'digest': 'sha256:e64b0d7eeb44034d3f2c301d3050b72c1639e683d5a0fd3b8aae3d6ac4789c7a' |
Scott Baker | 18ea0c3 | 2017-01-19 09:29:57 -0800 | [diff] [blame] | 144 | ], |
Matteo Scandolo | 951dd5b | 2017-05-25 07:35:47 -0700 | [diff] [blame] | 145 | 'gliderlabs/consul-server': [ |
Matteo Scandolo | 8957620 | 2017-05-18 18:39:43 -0700 | [diff] [blame] | 146 | 'type': 'image', |
| 147 | 'upstream': upstreamReg, |
| 148 | 'name': 'gliderlabs/consul-server', |
Matteo Scandolo | ccd20e8 | 2017-05-24 15:13:48 -0700 | [diff] [blame] | 149 | 'digest': 'sha256:37e194c7c941e37cf20b0cc5080541cfde9d31bf62a874905d0d51b3945f88c9' |
Matteo Scandolo | 8957620 | 2017-05-18 18:39:43 -0700 | [diff] [blame] | 150 | ], |
Matteo Scandolo | 951dd5b | 2017-05-25 07:35:47 -0700 | [diff] [blame] | 151 | 'gliderlabs/registrator': [ |
Matteo Scandolo | 8957620 | 2017-05-18 18:39:43 -0700 | [diff] [blame] | 152 | 'type': 'image', |
| 153 | 'upstream': upstreamReg, |
| 154 | 'name': 'gliderlabs/registrator', |
Matteo Scandolo | ccd20e8 | 2017-05-24 15:13:48 -0700 | [diff] [blame] | 155 | 'digest': 'sha256:6e708681dd52e28f4f39d048ac75376c9a762c44b3d75b2824173f8364e52c10' |
Matteo Scandolo | 8957620 | 2017-05-18 18:39:43 -0700 | [diff] [blame] | 156 | ] |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 157 | ] |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 158 | } |
| 159 | |
alshabib | 00c4b5d | 2016-06-17 17:26:10 -0700 | [diff] [blame] | 160 | // ---------------- Useful tasks ---------------- |
| 161 | |
Zack Williams | 0620c93 | 2017-01-25 14:36:31 -0700 | [diff] [blame] | 162 | task writeInventory(type: Copy) { |
| 163 | from 'ansible/cord-inv' |
| 164 | into 'genconfig' |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 165 | expand([ |
Zack Williams | 0620c93 | 2017-01-25 14:36:31 -0700 | [diff] [blame] | 166 | headnode_ip: config.headnode.ip, |
| 167 | headnode_user: config.headnode.ansible_user, |
| 168 | headnode_pass: config.headnode.ansible_ssh_pass, |
| 169 | headnode_port: config.headnode.ansible_ssh_port, |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 170 | ]) |
| 171 | } |
| 172 | |
| 173 | task writeYamlConfig { |
Zack Williams | 0620c93 | 2017-01-25 14:36:31 -0700 | [diff] [blame] | 174 | def outvar = config.common |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 175 | def outfilename = "genconfig/config.yml" |
| 176 | |
| 177 | DumperOptions options = new DumperOptions() |
| 178 | |
| 179 | options.setExplicitStart(true); |
| 180 | options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK) |
| 181 | options.setPrettyFlow(true); |
| 182 | options.setIndent(2); |
| 183 | |
| 184 | def yaml = new Yaml(options) |
| 185 | Writer outfile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfilename), "utf-8")) |
| 186 | |
| 187 | yaml.dump(outvar, outfile) |
| 188 | outfile.close() |
| 189 | } |
| 190 | |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 191 | |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 192 | task fetchUpstreamImages { |
Zsolt Haraszti | 3dbe616 | 2016-05-12 12:25:56 -0700 | [diff] [blame] | 193 | comps.each { name, spec -> if (spec.type == 'image') { dependsOn "fetch" + name } } |
| 194 | } |
| 195 | |
alshabib | 11b8e5c | 2016-08-29 15:36:36 -0700 | [diff] [blame] | 196 | task fetch { |
| 197 | dependsOn fetchUpstreamImages |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 198 | } |
| 199 | |
alshabib | 11b8e5c | 2016-08-29 15:36:36 -0700 | [diff] [blame] | 200 | task buildImages { |
| 201 | logger.info "Root project has nothing to build" |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 202 | } |
| 203 | |
| 204 | task publishImages { |
Andy Bavier | 24d2111 | 2017-03-13 10:09:31 -0400 | [diff] [blame] | 205 | comps.each { name, spec -> if (spec.type == 'image') { |
| 206 | dependsOn "publish" + name |
| 207 | } |
alshabib | 11b8e5c | 2016-08-29 15:36:36 -0700 | [diff] [blame] | 208 | } |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 209 | } |
| 210 | |
| 211 | task publish { |
Zsolt Haraszti | 3dbe616 | 2016-05-12 12:25:56 -0700 | [diff] [blame] | 212 | dependsOn publishImages |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 213 | } |
| 214 | |
| 215 | tasks.addRule(new DockerFetchRule(project)) |
alshabib | 11b8e5c | 2016-08-29 15:36:36 -0700 | [diff] [blame] | 216 | tasks.addRule(new DockerPublishRule(project, project(':maas').prime)) |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 217 | tasks.addRule(new DockerTagRule(project)) |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 218 | |
Zack Williams | 83a94ce | 2017-05-20 13:36:09 -0700 | [diff] [blame] | 219 | task PIcreateConfig(type: Exec) { |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 220 | dependsOn writeYamlConfig |
Zack Williams | 0620c93 | 2017-01-25 14:36:31 -0700 | [diff] [blame] | 221 | dependsOn writeInventory |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 222 | |
Andy Bavier | 96df5e6 | 2017-03-13 18:19:24 -0400 | [diff] [blame] | 223 | workingDir "platform-install" |
| 224 | executable = "ansible-playbook" |
| 225 | args = [ "-i", "../genconfig/cord-inv", |
| 226 | "--extra-vars", "@../genconfig/config.yml", |
Andy Bavier | 66ceea4 | 2017-07-26 09:06:00 -0700 | [diff] [blame] | 227 | "--extra-vars", "pull_docker_tag="+targetTag, |
| 228 | "--extra-vars", "pull_docker_registry=docker-registry:5000/", |
Zack Williams | 83a94ce | 2017-05-20 13:36:09 -0700 | [diff] [blame] | 229 | "cord-config-playbook.yml" ] |
| 230 | } |
| 231 | |
| 232 | task PIcopyCord(type: Exec) { |
| 233 | dependsOn PIcreateConfig |
| 234 | |
| 235 | workingDir "platform-install" |
| 236 | executable = "ansible-playbook" |
| 237 | args = [ "-i", "../genconfig/cord-inv", |
| 238 | "--extra-vars", "@../genconfig/config.yml", |
| 239 | "copy-cord-playbook.yml" ] |
| 240 | } |
| 241 | |
| 242 | task PIcopyProfile(type: Exec) { |
| 243 | dependsOn PIcreateConfig |
| 244 | |
| 245 | workingDir "platform-install" |
| 246 | executable = "ansible-playbook" |
| 247 | args = [ "-i", "../genconfig/cord-inv", |
| 248 | "--extra-vars", "@../genconfig/config.yml", |
| 249 | "copy-profile-playbook.yml" ] |
Andy Bavier | 96df5e6 | 2017-03-13 18:19:24 -0400 | [diff] [blame] | 250 | } |
| 251 | |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 252 | task PIprepPlatform(type: Exec) { |
Zack Williams | 83a94ce | 2017-05-20 13:36:09 -0700 | [diff] [blame] | 253 | dependsOn PIcreateConfig |
| 254 | dependsOn PIcopyCord |
| 255 | dependsOn PIcopyProfile |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 256 | |
Zack Williams | 83a94ce | 2017-05-20 13:36:09 -0700 | [diff] [blame] | 257 | workingDir "platform-install" |
| 258 | executable = "ansible-playbook" |
| 259 | args = [ "-i", "../genconfig/cord-inv", |
| 260 | "--extra-vars", "@../genconfig/config.yml", |
| 261 | "prep-platform-playbook.yml" ] |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | task PIdeployOpenStack (type: Exec) { |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 265 | |
Zack Williams | 31fbc6b | 2017-04-21 22:04:44 -0700 | [diff] [blame] | 266 | workingDir "platform-install" |
| 267 | executable = "ansible-playbook" |
| 268 | args = [ "-i", "../genconfig/cord-inv", |
| 269 | "--extra-vars", "@../genconfig/config.yml", |
Andy Bavier | 66ceea4 | 2017-07-26 09:06:00 -0700 | [diff] [blame] | 270 | "--extra-vars", "pull_docker_tag="+targetTag, |
| 271 | "--extra-vars", "pull_docker_registry=docker-registry:5000/", |
Zack Williams | 31fbc6b | 2017-04-21 22:04:44 -0700 | [diff] [blame] | 272 | "deploy-openstack-playbook.yml" ] |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | task PIdeployONOS (type: Exec) { |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 276 | |
Zack Williams | 83a94ce | 2017-05-20 13:36:09 -0700 | [diff] [blame] | 277 | workingDir "platform-install" |
| 278 | executable = "ansible-playbook" |
| 279 | args = [ "-i", "../genconfig/cord-inv", |
| 280 | "--extra-vars", "@../genconfig/config.yml", |
Andy Bavier | 66ceea4 | 2017-07-26 09:06:00 -0700 | [diff] [blame] | 281 | "--extra-vars", "pull_docker_tag="+targetTag, |
| 282 | "--extra-vars", "pull_docker_registry=docker-registry:5000/", |
Zack Williams | 83a94ce | 2017-05-20 13:36:09 -0700 | [diff] [blame] | 283 | "deploy-onos-playbook.yml" ] |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | task PIdeployXOS (type: Exec) { |
Andy Bavier | 66ceea4 | 2017-07-26 09:06:00 -0700 | [diff] [blame] | 287 | def extra_vars = "--extra-vars pull_docker_tag="+targetTag+" --extra-vars pull_docker_registry=docker-registry:5000/" |
Zack Williams | 83a94ce | 2017-05-20 13:36:09 -0700 | [diff] [blame] | 288 | def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml "+extra_vars+" launch-xos-playbook.yml" |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 289 | |
| 290 | executable = "ssh" |
Zack Williams | 0620c93 | 2017-01-25 14:36:31 -0700 | [diff] [blame] | 291 | args = ["-p", "$config.headnode.ansible_ssh_port", "$config.headnode.ansible_user@$config.headnode.ip", ansible_cmd ] |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 292 | } |
| 293 | |
| 294 | task PIsetupAutomation (type: Exec) { |
Zack Williams | 83a94ce | 2017-05-20 13:36:09 -0700 | [diff] [blame] | 295 | def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-automation-playbook.yml" |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 296 | |
| 297 | executable = "ssh" |
Zack Williams | 0620c93 | 2017-01-25 14:36:31 -0700 | [diff] [blame] | 298 | args = ["-p", "$config.headnode.ansible_ssh_port", "$config.headnode.ansible_user@$config.headnode.ip", ansible_cmd ] |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 299 | } |
| 300 | |
Zack Williams | 4fd3dcc | 2017-02-08 20:46:14 -0700 | [diff] [blame] | 301 | task PIrunDiag (type: Exec) { |
Zack Williams | 0620c93 | 2017-01-25 14:36:31 -0700 | [diff] [blame] | 302 | def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml collect-diag-playbook.yml" |
Zack Williams | 4fd3dcc | 2017-02-08 20:46:14 -0700 | [diff] [blame] | 303 | |
| 304 | executable = "ssh" |
Zack Williams | 0620c93 | 2017-01-25 14:36:31 -0700 | [diff] [blame] | 305 | args = ["-p", "$config.headnode.ansible_ssh_port", "$config.headnode.ansible_user@$config.headnode.ip", ansible_cmd ] |
Zack Williams | 4fd3dcc | 2017-02-08 20:46:14 -0700 | [diff] [blame] | 306 | } |
| 307 | |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 308 | task postDeployTests (type: Exec) { |
| 309 | |
Zack Williams | 83a94ce | 2017-05-20 13:36:09 -0700 | [diff] [blame] | 310 | def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml pod-test-playbook.yml" |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 311 | |
| 312 | executable = "ssh" |
Zack Williams | 0620c93 | 2017-01-25 14:36:31 -0700 | [diff] [blame] | 313 | args = ["-p", "$config.headnode.ansible_ssh_port", "$config.headnode.ansible_user@$config.headnode.ip", ansible_cmd ] |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 314 | } |
| 315 | |
Zack Williams | 03a20ec | 2017-04-12 17:39:36 -0700 | [diff] [blame] | 316 | project(':maas').prime.dependsOn writeYamlConfig |
| 317 | project(':maas').prime.dependsOn writeInventory |
| 318 | |
alshabib | 11b8e5c | 2016-08-29 15:36:36 -0700 | [diff] [blame] | 319 | project('onos-apps').publishMavenRepoImage.dependsOn project(':maas').prime |
alshabib | c64cf7f | 2016-09-07 11:47:01 -0700 | [diff] [blame] | 320 | project(':onos-apps').deploy.dependsOn project(':maas').deployBase |
| 321 | |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 322 | project('onos-apps').publishMavenRepoImage.dependsOn project(':maas').prime |
| 323 | project(':onos-apps').deploy.dependsOn project(':maas').deployBase |
| 324 | |
Andy Bavier | 2f151eb | 2017-05-04 16:39:13 -0700 | [diff] [blame] | 325 | // Ensure nginx:candidate exists |
Andy Bavier | 619b635 | 2017-04-26 15:30:23 -0700 | [diff] [blame] | 326 | project(':orchestration:xos').buildImages.dependsOn rootProject."tagnginx" |
Andy Bavier | 96df5e6 | 2017-03-13 18:19:24 -0400 | [diff] [blame] | 327 | |
Zack Williams | 83a94ce | 2017-05-20 13:36:09 -0700 | [diff] [blame] | 328 | // make PI config tasks run before maas deploy |
| 329 | project(':maas').deployBase.dependsOn PIcopyProfile |
| 330 | |
Andy Bavier | 2f151eb | 2017-05-04 16:39:13 -0700 | [diff] [blame] | 331 | // For corebuilder |
Scott Baker | a6e5dd1 | 2017-04-17 10:08:16 -0700 | [diff] [blame] | 332 | project(':platform-install').buildImages.dependsOn project(':orchestration:xos').buildImages |
| 333 | |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 334 | task PIdeployPlatform { |
Zack Williams | 83a94ce | 2017-05-20 13:36:09 -0700 | [diff] [blame] | 335 | dependsOn PIcopyCord |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 336 | dependsOn project(':onos-apps').deploy |
| 337 | dependsOn project(':maas').deployBase |
| 338 | dependsOn PIprepPlatform |
| 339 | dependsOn PIdeployOpenStack |
| 340 | dependsOn PIdeployONOS |
| 341 | dependsOn PIdeployXOS |
| 342 | dependsOn PIsetupAutomation |
| 343 | } |
| 344 | |
Zack Williams | 83a94ce | 2017-05-20 13:36:09 -0700 | [diff] [blame] | 345 | PIprepPlatform.mustRunAfter PIcopyCord |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 346 | PIdeployOpenStack.mustRunAfter PIprepPlatform |
| 347 | PIdeployONOS.mustRunAfter PIdeployOpenStack |
| 348 | PIdeployXOS.mustRunAfter PIdeployONOS |
| 349 | PIsetupAutomation.mustRunAfter PIdeployXOS |
| 350 | PIdeployPlatform.mustRunAfter project(':onos-apps').deploy |
| 351 | PIdeployPlatform.mustRunAfter project(':maas').deployBase |
Andy Bavier | beb89c0 | 2016-07-07 13:26:55 -0400 | [diff] [blame] | 352 | |
alshabib | 11b8e5c | 2016-08-29 15:36:36 -0700 | [diff] [blame] | 353 | task deploy { |
Zack Williams | 38d8c7f | 2017-01-23 07:35:36 -0700 | [diff] [blame] | 354 | dependsOn PIdeployPlatform |
Zsolt Haraszti | ec7df10 | 2016-05-05 13:34:18 -0700 | [diff] [blame] | 355 | } |