diff options
author | Narinder Gupta <narinder.gupta@canonical.com> | 2016-05-17 18:47:10 -0500 |
---|---|---|
committer | Narinder Gupta <narinder.gupta@canonical.com> | 2016-05-17 19:34:54 -0500 |
commit | 2ee0a05504d8e9f48ea25652e8aba518fb734964 (patch) | |
tree | 0659b705c82ddd9de786963bd7f1579122c4513c /ci/02-maasdeploy.sh | |
parent | e957fbd5c8afdff83939980c3a32a8f896df41a1 (diff) |
modified to support the custom lab where data will be provided
fom labconfig.yaml file.
Change-Id: Ic6ff690175de1029909b89590226847b78b6e437
Signed-off-by: Narinder Gupta <narinder.gupta@canonical.com>
Diffstat (limited to 'ci/02-maasdeploy.sh')
-rwxr-xr-x | ci/02-maasdeploy.sh | 50 |
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 |