summaryrefslogtreecommitdiffstats
path: root/compass-tasks/build.sh
diff options
context:
space:
mode:
authorJustin chi <chigang@huawei.com>2017-11-03 08:43:12 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-11-03 08:43:12 +0000
commitd143e4895b1674f35738b579eec0704bc50cd5fa (patch)
tree4d9b3dbb9562843d60c22d7378589e55798409db /compass-tasks/build.sh
parentfce3a0b2765f1e521b7f8d31772f443849c2bb12 (diff)
parent8120b2583c459c85116d69211038e0110d71e5b7 (diff)
Merge "Add compass-tasks"
Diffstat (limited to 'compass-tasks/build.sh')
-rwxr-xr-xcompass-tasks/build.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/compass-tasks/build.sh b/compass-tasks/build.sh
new file mode 100755
index 0000000..e0dceea
--- /dev/null
+++ b/compass-tasks/build.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2016-2017 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# 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
+##############################################################################
+set -x
+COMPASS_DIR=${BASH_SOURCE[0]%/*}
+
+rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
+sed -i 's/^mirrorlist=https/mirrorlist=http/g' /etc/yum.repos.d/epel.repo
+yum update -y
+
+yum --nogpgcheck install -y python python-devel git amqp python-pip libffi-devel openssl-devel gcc python-setuptools MySQL-python supervisor redis sshpass python-keyczar vim ansible-2.2.1.0 libyaml-devel make
+
+mkdir -p $COMPASS_DIR/compass
+touch $COMPASS_DIR/compass/__init__.py
+mv $COMPASS_DIR/actions $COMPASS_DIR/compass/
+mv $COMPASS_DIR/apiclient $COMPASS_DIR/compass/
+mv $COMPASS_DIR/tasks $COMPASS_DIR/compass/
+mv $COMPASS_DIR/utils $COMPASS_DIR/compass/
+mv $COMPASS_DIR/deployment $COMPASS_DIR/compass/
+mv $COMPASS_DIR/db $COMPASS_DIR/compass/
+mv $COMPASS_DIR/hdsdiscovery $COMPASS_DIR/compass/
+mv $COMPASS_DIR/log_analyzor $COMPASS_DIR/compass/
+
+easy_install --upgrade pip
+pip install --upgrade pip
+pip install --upgrade setuptools
+pip install --upgrade Flask
+
+mkdir -p /etc/compass/
+mkdir -p /etc/compass/machine_list
+mkdir -p /etc/compass/switch_list
+mkdir -p /var/log/compass
+mkdir -p /opt/ansible_callbacks
+mkdir -p /root/.ssh;
+echo "UserKnownHostsFile /dev/null" >> /root/.ssh/config;
+echo "StrictHostKeyChecking no" >> /root/.ssh/config
+
+cd $COMPASS_DIR
+python setup.py install
+cp supervisord.conf /etc/supervisord.conf
+cp start.sh /usr/local/bin/start.sh
+
+yum clean all
+
+set -x