summaryrefslogtreecommitdiffstats
path: root/jjb/joid/joid-deploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/joid/joid-deploy.sh')
-rw-r--r--jjb/joid/joid-deploy.sh97
1 files changed, 52 insertions, 45 deletions
diff --git a/jjb/joid/joid-deploy.sh b/jjb/joid/joid-deploy.sh
index 05c2de1fc..e197dbd8c 100644
--- a/jjb/joid/joid-deploy.sh
+++ b/jjb/joid/joid-deploy.sh
@@ -45,17 +45,24 @@ export POD_NAME=${POD/-}
##
cd $WORKSPACE/ci
-if [ -e "$LAB_CONFIG/environments.yaml" ] && [ "$MAAS_REINSTALL" == "false" ]; then
+
+if [ -e "$LAB_CONFIG/deployconfig.yaml" ] && [ "$MAAS_REINSTALL" == "false" ]; then
echo "------ Recover Juju environment to use MAAS ------"
- cp $LAB_CONFIG/environments.yaml .
- cp $LAB_CONFIG/deployment.yaml .
- if [ -e $LAB_CONFIG/deployconfig.yaml ]; then
+ if [ ! -e deployconfig.yaml ]; then
cp $LAB_CONFIG/deployconfig.yaml .
+ cp $LAB_CONFIG/deployment.yaml .
+ cp $LAB_CONFIG/labconfig.yaml .
fi
else
- echo "------ Redeploy MAAS ------"
- ./00-maasdeploy.sh $POD_NAME
- exit_on_error $? "MAAS Deploy FAILED"
+ if ["$NODE_NAME" == "default" ]; then
+ echo "------ Redeploy MAAS ------"
+ ./03-maasdeploy.sh default
+ exit_on_error $? "MAAS Deploy FAILED"
+ else
+ echo "------ Redeploy MAAS ------"
+ ./03-maasdeploy.sh custom $LAB_CONFIG/labconfig.yaml
+ exit_on_error $? "MAAS Deploy FAILED"
+ fi
fi
##
@@ -64,8 +71,9 @@ fi
# Based on scenario naming we can get joid options
# naming convention:
-# os-<controller>-<nfvfeature>-<mode>[-<extrastuff>]
+# <model>-<controller>-<nfvfeature>-<mode>[-<extrastuff>]
# With parameters:
+# model=(os|k8)
# controller=(nosdn|odl_l3|odl_l2|onos|ocl)
# No odl_l3 today
# nfvfeature=(kvm|ovs|dpdk|nofeature)
@@ -77,6 +85,7 @@ fi
IFS='-' read -r -a DEPLOY_OPTIONS <<< "${DEPLOY_SCENARIO}--"
#last -- need to avoid nounset error
+JOID_MODEL=${DEPLOY_OPTIONS[0]}
SDN_CONTROLLER=${DEPLOY_OPTIONS[1]}
NFV_FEATURES=${DEPLOY_OPTIONS[2]}
HA_MODE=${DEPLOY_OPTIONS[3]}
@@ -103,49 +112,47 @@ fi
## Configure Joid deployment
##
-echo "------ Deploy with juju ------"
-echo "Execute: ./deploy.sh -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES"
+if [ "$JOID_MODEL" == 'k8' ]; then
+ echo "------ Deploy with juju ------"
+ echo "Execute: ./deploy.sh -m $JOID_MODEL -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES"
-./deploy.sh -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES
-exit_on_error $? "Main deploy FAILED"
+ ./deploy.sh -m kubernetes -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES
+ exit_on_error $? "Main deploy FAILED"
+fi
##
## Set Admin RC
##
-JOID_ADMIN_OPENRC=$LAB_CONFIG/admin-openrc
-echo "------ Create OpenRC file [$JOID_ADMIN_OPENRC] ------"
-
-# get controller IP
-case "$SDN_CONTROLLER" in
- "odl")
- SDN_CONTROLLER_IP=$(juju status odl-controller/0 |grep public-address|sed -- 's/.*\: //')
- ;;
- "onos")
- SDN_CONTROLLER_IP=$(juju status onos-controller/0 |grep public-address|sed -- 's/.*\: //')
- ;;
- *)
- SDN_CONTROLLER_IP='none'
- ;;
-esac
-SDN_PASSWORD='admin'
-
-# export the openrc file by getting the one generated by joid and add SDN
-# controller for Functest
-cp ./cloud/admin-openrc $JOID_ADMIN_OPENRC
-cat << EOF >> $JOID_ADMIN_OPENRC
-export SDN_CONTROLLER=$SDN_CONTROLLER_IP
-export SDN_PASSWORD=$SDN_PASSWORD
-EOF
-
-##
-## Backup local juju env
-##
+if [ "$JOID_MODEL" == 'os' ]; then
+ echo "------ Deploy with juju ------"
+ echo "Execute: ./deploy.sh -m $JOID_MODEL -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES"
+
+ ./deploy.sh -m openstack -t $HA_MODE -o $OS_RELEASE -s $SDN_CONTROLLER -l $POD_NAME -d $UBUNTU_DISTRO -f $NFV_FEATURES
+ exit_on_error $? "Main deploy FAILED"
+
+ JOID_ADMIN_OPENRC=$LAB_CONFIG/admin-openrc
+ echo "------ Create OpenRC file [$JOID_ADMIN_OPENRC] ------"
+
+ # get controller IP
+ case "$SDN_CONTROLLER" in
+ "odl")
+ SDN_CONTROLLER_IP=$(juju status odl-controller/0 |grep public-address|sed -- 's/.*\: //')
+ ;;
+ "onos")
+ SDN_CONTROLLER_IP=$(juju status onos-controller/0 |grep public-address|sed -- 's/.*\: //')
+ ;;
+ *)
+ SDN_CONTROLLER_IP='none'
+ ;;
+ esac
+ SDN_PASSWORD='admin'
+
+ # export the openrc file by getting the one generated by joid and add SDN
+ # controller for Functest
+ # cp ./cloud/admin-openrc $JOID_ADMIN_OPENRC
+ echo export SDN_CONTROLLER=$SDN_CONTROLLER_IP >> $JOID_ADMIN_OPENRC
+ echo export SDN_PASSWORD=$SDN_PASSWORD >> $JOID_ADMIN_OPENRC
-echo "------ Backup Juju environment ------"
-cp environments.yaml $LAB_CONFIG/
-cp deployment.yaml $LAB_CONFIG/
-if [ -e deployconfig.yaml ]; then
- cp deployconfig.yaml $LAB_CONFIG
fi
##