summaryrefslogtreecommitdiffstats
path: root/compass/deploy/deploy-vm.sh
diff options
context:
space:
mode:
authorJerry Zhao <zhaoxinyu@huawei.com>2015-04-11 08:21:10 +0800
committerJerry Zhao <zhaoxinyu@huawei.com>2015-04-20 20:46:01 +0800
commit77bf95508534a744c4b6e7b5635ec1e8eb294098 (patch)
tree38ed362a6a88b7bc7e010a6614f0de6146a5920a /compass/deploy/deploy-vm.sh
parente1d29739ccbc6efc20f400636a211dae0e75bff4 (diff)
first commit of deploy.sh for compass
with deploy.sh in this patch, a compass vagrant box will be spawned along with 5 libvirt vms. compass api will be called to install ubuntu 14.04 on those libvirt vms. in a patch later, openstack will be configured to be installed. JIRA: BGS-28 Change-Id: Ie5f8442331081289a1a81a8e3295c881b0504c3c Signed-off-by: Jerry Zhao <zhaoxinyu@huawei.com>
Diffstat (limited to 'compass/deploy/deploy-vm.sh')
-rw-r--r--compass/deploy/deploy-vm.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/compass/deploy/deploy-vm.sh b/compass/deploy/deploy-vm.sh
new file mode 100644
index 0000000..18857cd
--- /dev/null
+++ b/compass/deploy/deploy-vm.sh
@@ -0,0 +1,45 @@
+cd ..
+rm -rf compass-core
+git clone http://git.openstack.org/stackforge/compass-core -b dev/experimental
+cd compass-core
+virtualenv venv
+source venv/bin/activate
+pip install -i http://pypi.douban.com/simple -e .
+if [[ ! -f /var/log/compass ]]; then
+ sudo mkdir /var/log/compass
+ sudo chown -R 777 /var/log/compass
+fi
+if [[ ! -f /etc/compass ]]; then
+ sudo mkdir /etc/compass
+ sudo cp -rf conf/setting /etc/compass/.
+fi
+cp bin/switch_virtualenv.py.template bin/switch_virtualenv.py
+sed -i "s|\$PythonHome|$VIRTUAL_ENV|g" bin/switch_virtualenv.py
+#source ../compass-install/ci/allinone.conf
+bin/client.py --logfile= --loglevel=debug --logdir= --compass_server="${COMPASS_SERVER_URL}" \
+--compass_user_email="${COMPASS_USER_EMAIL}" --compass_user_password="${COMPASS_USER_PASSWORD}" \
+--cluster_name="${CLUSTER_NAME}" --language="${LANGUAGE}" --timezone="${TIMEZONE}" \
+--hostnames="${HOSTNAMES}" --partitions="${PARTITIONS}" --subnets="${SUBNETS}" \
+--adapter_os_pattern="${ADAPTER_OS_PATTERN}" --adapter_name="${ADAPTER_NAME}" \
+--adapter_target_system_pattern="${ADAPTER_TARGET_SYSTEM_PATTERN}" \
+--adapter_flavor_pattern="${ADAPTER_FLAVOR_PATTERN}" \
+--http_proxy="${PROXY}" --https_proxy="${PROXY}" --no_proxy="${IGNORE_PROXY}" \
+--ntp_server="${NTP_SERVER}" --dns_servers="${NAMESERVERS}" --domain="${DOMAIN}" \
+--search_path="${SEARCH_PATH}" --default_gateway="${GATEWAY}" \
+--server_credential="${SERVER_CREDENTIAL}" --local_repo_url="${LOCAL_REPO_URL}" \
+--os_config_json_file="${OS_CONFIG_FILENAME}" --service_credentials="${SERVICE_CREDENTIALS}" \
+--console_credentials="${CONSOLE_CREDENTIALS}" --host_networks="${HOST_NETWORKS}" \
+--network_mapping="${NETWORK_MAPPING}" --package_config_json_file="${PACKAGE_CONFIG_FILENAME}" \
+--host_roles="${HOST_ROLES}" --default_roles="${DEFAULT_ROLES}" --switch_ips="${SWITCH_IPS}" \
+--machines=${machines//\'} --switch_credential="${SWITCH_CREDENTIAL}" \
+--deployment_timeout="${DEPLOYMENT_TIMEOUT}" --${POLL_SWITCHES_FLAG} --dashboard_url="${DASHBOARD_URL}"
+deploy_result=$?
+tear_down_machines
+cd ../compass-install
+sudo vagrant destroy compass_nodocker
+if [[ $deploy_result != 0 ]]; then
+ echo "deployment failed"
+ exit 1
+else
+ echo "deployment complete"
+fi