blob: 17f9e5d69d954bd25aaabe3632976d9855f211f9 [file] [log] [blame]
Matteo Scandolo42f6e572021-01-25 15:11:34 -08001// 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
4def 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 Scandolo2bc660a2021-02-12 10:52:25 -080014 stackName: "voltha",
15 stackId: 1,
Matteo Scandolo42f6e572021-01-25 15:11:34 -080016 workflow: "att",
17 extraHelmFlags: "",
Matteo Scandolofcfc60d2021-02-24 09:06:48 -080018 localCharts: false, // wether to use locally cloned charts or upstream one (for local we assume they are stored in $WORKSPACE/voltha-helm-charts)
Matteo Scandolo37f168b2021-04-15 16:20:46 -070019 dockerRegistry: "", // use a different docker registry for all images, eg: "mirror.registry.opennetworking.org"
Matteo Scandolod82d1de2021-04-06 14:55:58 -070020 kubeconfig: null, // location of the kubernetes config file, if null we assume it's stored in the $KUBECONFIG environment variable
Matteo Scandolo42f6e572021-01-25 15:11:34 -080021 ]
22
23 if (!config) {
24 config = [:]
25 }
26
27 def cfg = defaultConfig + config
28
Matteo Scandolo37f168b2021-04-15 16:20:46 -070029 if (cfg.dockerRegistry != "") {
Matteo Scandolo59470992021-04-20 11:30:57 -070030 cfg.extraHelmFlags += " --set global.image_registry=${cfg.dockerRegistry}/ "
31 cfg.extraHelmFlags += " --set etcd.image.registry=${cfg.dockerRegistry} "
32 cfg.extraHelmFlags += " --set kafka.image.registry=${cfg.dockerRegistry} "
33 cfg.extraHelmFlags += " --set kafka.zookeper.image.registry=${cfg.dockerRegistry} "
34 cfg.extraHelmFlags += " --set onos-classic.image.repository=${cfg.dockerRegistry}/voltha/voltha-onos "
35 cfg.extraHelmFlags += " --set onos-classic.atomix.image.repository=${cfg.dockerRegistry}/atomix/atomix "
36 cfg.extraHelmFlags += " --set freeradius.images.radius.registry=${cfg.dockerRegistry}/ "
Matteo Scandolo37f168b2021-04-15 16:20:46 -070037 }
38
Matteo Scandolo42f6e572021-01-25 15:11:34 -080039 println "Deploying VOLTHA with the following parameters: ${cfg}."
40
41 volthaInfraDeploy(cfg)
42
43 volthaStackDeploy(cfg)
44}