summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorYao Lu <lu.yao135@zte.com.cn>2016-11-11 15:39:35 +0800
committerYao Lu <lu.yao135@zte.com.cn>2016-11-11 07:47:50 +0000
commit293037b6775c4f6147546662640b9e8f88206efd (patch)
treefde9f24686f76cb050e62638b3719f5fd07cb771 /ci
parent37c4cc04d0a3ac8891888f5625efb3b40ad0ac96 (diff)
add deploy script
Change-Id: I1f12690f4f736adbd42222561edd18ca4b7c6925 Signed-off-by: Yao Lu <lu.yao135@zte.com.cn>
Diffstat (limited to 'ci')
-rwxr-xr-xci/deploy/deploy.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/ci/deploy/deploy.sh b/ci/deploy/deploy.sh
new file mode 100755
index 00000000..234bf3be
--- /dev/null
+++ b/ci/deploy/deploy.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2016 ZTE Coreporation and others.
+# hu.zhijiang@zte.com.cn
+# sun.jing22@zte.com.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+#daisy host discover
+DAISYDIR=
+json_file=$DAISYDIR/deploy/config/vm_environment/zte-virtual/template.json
+source ~/daisyrc_admin
+daisy discover-host-add 192.168.122.152 ossdbg1
+daisy discover-host
+
+cnt=30
+while [ $cnt -ge 0 ]; do
+ host_id=`daisy host-list | awk -F "|" '{print $2}'| grep -o "[^ ]\+\( \+[^ ]\+\)*" `
+ if [ -z "$host_id" ]; then
+ echo "host have not discoverd , loop again ... "
+ cnt=$[$cnt-1]
+ sleep 30
+ else
+ echo "host list checkout successful... "
+ break
+ fi
+done
+daisy host-list
+
+echo "======prepare install os(centos) & kolla(openstack) ==========="
+daisy import-json-to-template $json_file
+daisy import-template-to-db template testdaisy
+daisy template-to-host testdaisy DaisyNode $host_id
+
+echo "======daisy install kolla(openstack)==========="
+cluster_id=`daisy cluster-list | awk -F "|" '{print $2}' | sed -n '4p'`
+daisy install $cluster_id
+
+echo "check installing proess..."
+var=1
+while [ $var -eq 1 ]; do
+ echo "loop for judge openstack installing progress..."
+ openstack_install_active=`daisy host-list --cluster-id $cluster_id | awk -F "|" '{print $12}' | grep -c "active" `
+ openstack_install_failed=`daisy host-list --cluster-id $cluster_id | awk -F "|" '{print $12}' | grep -c "install-failed" `
+ if [ $openstack_install_active -eq 1 ]; then
+ echo "openstack installing successful ..."
+ break
+ elif [ $openstack_install_failed -gt 0 ]; then
+ echo "openstack installing have failed..."
+ tail -n 200 /var/log/daisy/kolla_$cluster_id*
+ exit 1
+ else
+ echo " openstack in installing , please waiting ..."
+ fi
+done
+exit 0 \ No newline at end of file