Matteo Scandolo | 42f6e57 | 2021-01-25 15:11:34 -0800 | [diff] [blame] | 1 | // this keyword is dedicated to deploy a single VOLTHA stack with infra |
| 2 | // If you need to deploy different configurations you can use the volthaInfraDeploy and volthaStackDeploy keywords |
| 3 | |
| 4 | def call(Map config) { |
| 5 | // note that I can't define this outside the function as there's no global scope in Groovy |
| 6 | def defaultConfig = [ |
| 7 | onosReplica: 1, |
| 8 | atomixReplica: 1, |
| 9 | kafkaReplica: 1, |
| 10 | etcdReplica: 1, |
| 11 | bbsimReplica: 1, |
| 12 | infraNamespace: "infra", |
| 13 | volthaNamespace: "voltha", |
Matteo Scandolo | 2bc660a | 2021-02-12 10:52:25 -0800 | [diff] [blame] | 14 | stackName: "voltha", |
| 15 | stackId: 1, |
Matteo Scandolo | 42f6e57 | 2021-01-25 15:11:34 -0800 | [diff] [blame] | 16 | workflow: "att", |
| 17 | extraHelmFlags: "", |
Matteo Scandolo | fcfc60d | 2021-02-24 09:06:48 -0800 | [diff] [blame] | 18 | localCharts: false, // wether to use locally cloned charts or upstream one (for local we assume they are stored in $WORKSPACE/voltha-helm-charts) |
Matteo Scandolo | 37f168b | 2021-04-15 16:20:46 -0700 | [diff] [blame] | 19 | dockerRegistry: "", // use a different docker registry for all images, eg: "mirror.registry.opennetworking.org" |
Matteo Scandolo | 42f6e57 | 2021-01-25 15:11:34 -0800 | [diff] [blame] | 20 | ] |
| 21 | |
| 22 | if (!config) { |
| 23 | config = [:] |
| 24 | } |
| 25 | |
| 26 | def cfg = defaultConfig + config |
| 27 | |
Matteo Scandolo | 37f168b | 2021-04-15 16:20:46 -0700 | [diff] [blame] | 28 | if (cfg.dockerRegistry != "") { |
| 29 | extraHelmFlags += " --set global.image_registry=${cfg.dockerRegistry}/ " |
| 30 | extraHelmFlags += " --set etcd.image.registry=${cfg.dockerRegistry} " |
| 31 | extraHelmFlags += " --set kafka.image.registry=${cfg.dockerRegistry} " |
| 32 | extraHelmFlags += " --set kafka.zookeper.image.registry=${cfg.dockerRegistry} " |
| 33 | extraHelmFlags += " --set onos-classic.image.repository=${cfg.dockerRegistry}/voltha/voltha-onos " |
| 34 | extraHelmFlags += " --set onos-classic.atomix.image.repository=${cfg.dockerRegistry}/atomix/atomix " |
| 35 | extraHelmFlags += " --set freeradius.images.radius.registry=${cfg.dockerRegistry}/ " |
| 36 | } |
| 37 | |
Matteo Scandolo | 42f6e57 | 2021-01-25 15:11:34 -0800 | [diff] [blame] | 38 | println "Deploying VOLTHA with the following parameters: ${cfg}." |
| 39 | |
| 40 | volthaInfraDeploy(cfg) |
| 41 | |
| 42 | volthaStackDeploy(cfg) |
| 43 | } |