summaryrefslogtreecommitdiffstats
path: root/ci/02-maasdeploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/02-maasdeploy.sh')
-rwxr-xr-xci/02-maasdeploy.sh50
1 files changed, 40 insertions, 10 deletions
diff --git a/ci/02-maasdeploy.sh b/ci/02-maasdeploy.sh
index d5691543..131e7056 100755
--- a/ci/02-maasdeploy.sh
+++ b/ci/02-maasdeploy.sh
@@ -4,8 +4,44 @@ set -ex
virtinstall=0
+#install the packages needed
+sudo apt-add-repository ppa:maas-deployers/stable -y
+sudo apt-add-repository ppa:juju/stable -y
+sudo apt-add-repository ppa:maas/stable -y
+sudo apt-add-repository cloud-archive:liberty -y
+sudo apt-get update -y
+sudo apt-get dist-upgrade -y
+sudo apt-get install openssh-server git maas-deployer juju juju-deployer maas-cli python-pip python-openstackclient gsutil -y
+
cp maas/deployment.yaml ./deployment.yaml
-cp ../labconfig/intel/pod6/labconfig.yaml ./
+
+#first parameter should be custom and second should be either
+# absolute location of file (including file name) or url of the
+# file to download.
+
+if [ "$1" == "custom" ]; then
+ if [ -e $2 ]; then
+ cp $2 ./labconfig.yaml || true
+ python deploy.py
+ else
+ wget $2 -t 3 -T 10 -O ./labconfig.yaml || true
+ count=`wc -l labconfig.yaml | cut -d " " -f 1`
+
+ if [ $count -lt 10 ]; then
+ rm -rf labconfig.yaml
+ else
+ python deploy.py
+ fi
+ fi
+
+ if [ ! -e ./labconfig.yaml ]; then
+ virtinstall=1
+ cp ../labconfig/default/labconfig.yaml ./
+ python deploy.py
+ fi
+fi
+
+exit 1
case "$1" in
'intelpod5' )
@@ -19,7 +55,9 @@ case "$1" in
python deploy.py
;;
'intelpod9' )
- cp maas/intel/pod9/deployment.yaml ./deployment.yaml
+ cp ../labconfig/intel/pod6/labconfig.yaml ./
+ #to be removed later once converted for all labs.
+ python deploy.py
;;
'orangepod1' )
cp maas/orange/pod1/deployment.yaml ./deployment.yaml
@@ -78,14 +116,6 @@ sudo virsh pool-define-as default --type dir --target /var/lib/libvirt/images/ |
sudo virsh pool-start default || true
sudo virsh pool-autostart default || true
-sudo apt-add-repository ppa:maas-deployers/stable -y
-sudo apt-add-repository ppa:juju/stable -y
-sudo apt-add-repository ppa:maas/stable -y
-sudo apt-add-repository cloud-archive:liberty -y
-sudo apt-get update -y
-sudo apt-get dist-upgrade -y
-sudo apt-get install openssh-server git maas-deployer juju juju-deployer maas-cli python-pip python-openstackclient gsutil -y
-
# To avoid problem between apiclient/maas_client and apiclient from google
# we remove the package google-api-python-client from yardstick installer
if [ $(pip list |grep google-api-python-client |wc -l) == 1 ]; then