Add the user role into project with admin_domain.
[joid.git] / ci / 01-bootstrap.sh
index 59a2219..88f87dd 100755 (executable)
@@ -4,11 +4,19 @@ set -ex
 
 #export JUJU_DEV_FEATURE_FLAGS=address-allocation
 
-juju bootstrap --debug --to bootstrap.maas
-sleep 5
-#disable juju gui until xenial charms are in charm store.
-juju deploy cs:juju-gui-130 --to 0
+jujuver=`juju --version`
 
-JUJU_REPOSITORY=
-juju set-constraints tags=
+if [[ "$jujuver" < "2" ]]; then
+  juju bootstrap --debug --to bootstrap.maas --agent-version 1.25.5
+  sleep 5
+  #disable juju gui until xenial charms are in charm store.
+  juju deploy cs:juju-gui-130 --to 0
 
+  JUJU_REPOSITORY=
+  juju set-constraints tags=
+
+else
+  controllername=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployconfig.yaml`
+  cloudname=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployconfig.yaml`
+  juju bootstrap $controllername $cloudname --debug --to bootstrap.maas
+fi