diff options
author | 2017-01-07 01:02:23 +0000 | |
---|---|---|
committer | 2017-01-07 01:02:23 +0000 | |
commit | a7d5aa4e6b0e611458df01ffcf4403cc2d827f52 (patch) | |
tree | 9e131c18f9f0e3f0002abbf85a8e49c47f1b9d16 /ci | |
parent | e412a63ae5a0791512347d7ab842f27f0afc59aa (diff) | |
parent | a14e0a1115f0b84c140d669250c98554ff20fcd8 (diff) |
Merge "clean up env before deploy"
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/deploy/deploy.sh | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/ci/deploy/deploy.sh b/ci/deploy/deploy.sh index 91d97784..79ec2439 100755 --- a/ci/deploy/deploy.sh +++ b/ci/deploy/deploy.sh @@ -13,6 +13,7 @@ # exit 0 ##########TODO after test########## +WORKDIR=/tmp/workdir DHA=$WORKSPACE/$1 NETWORK=$WORKSPACE/$2 deploy_path=$WORKSPACE/deploy @@ -33,16 +34,22 @@ daisy_gateway=`echo $parameter_from_deploy | cut -d " " -f 6` function execute_on_jumpserver { - ssh $1 -o UserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no $2 + local jumpserver_ip=$1 + local cmd=$2 + ssh $jumpserver_ip -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $cmd } function create_node { - virsh net-define $1 - virsh net-autostart $2 - virsh net-start $2 - virsh define $3 - virsh start $4 + local net_template=$1 + local net_name=$2 + local vms_template=$3 + local vms_name=$4 + virsh net-define $net_template + virsh net-autostart $net_name + virsh net-start $net_name + virsh define $vms_template + virsh start $vms_name } #update key = value config option in an conf or ini file @@ -79,9 +86,25 @@ function update_config fi } +function clean_up +{ + local vm_name=$1 + local network_name=$2 + virsh destroy $vm_name + virsh undefine $vm_name + virsh net-destroy $network_name + virsh net-undefine $network_name +} + +echo "=====clean up all node and network======" +clean_up all_in_one daisy2 +clean_up daisy daisy1 +if [ -f $WORKDIR/daisy ]; then + rm -rf $WORKDIR +fi + echo "=======create daisy node================" $create_qcow2_path/daisy-img-modify.sh -c $create_qcow2_path/centos-img-modify.sh -a $daisy_ip -g $daisy_gateway -s $daisyserver_size -#qemu-img resize centos7.qcow2 100G create_node $net_daisy1 daisy1 $pod_daisy daisy sleep 20 @@ -103,7 +126,7 @@ fi echo "====== add relate config of kolla===========" execute_on_jumpserver $daisy_ip "mkdir -p /etc/kolla/config/nova" -execute_on_jumpserver $daisy_ip "echo -e "[libvirt]\nvirt_type=qemu" > /etc/kolla/config/nova/nova-compute.conf" +execute_on_jumpserver $daisy_ip "echo -e '[libvirt]\nvirt_type=qemu' > /etc/kolla/config/nova/nova-compute.conf" echo "===prepare cluster and pxe===" execute_on_jumpserver $daisy_ip "python $WORKSPACE/deploy/tempest.py --dha $DHA --network $NETWORK --cluster "yes"" @@ -121,6 +144,8 @@ virsh destroy all_in_one virsh start all_in_one echo "===========check install progress===========" +execute_on_jumpserver $daisy_ip "systemctl restart daisy-api" +execute_on_jumpserver $daisy_ip "systemctl restart daisy-registry" execute_on_jumpserver $daisy_ip "$WORKSPACE/deploy/check_os_progress.sh" virsh reboot all_in_one execute_on_jumpserver $daisy_ip "$WORKSPACE/deploy/check_openstack_progress.sh" |