From 905b0231e93ce2409a45dd6c4f5f983689fdb790 Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Wed, 1 Nov 2017 11:56:50 +0800 Subject: Add compass-deck RESTful API and DB Handlers for Compass Change-Id: I1ce411f279943764c286ea48dca9185d453cf254 Signed-off-by: Harry Huang --- compass-deck/build.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 compass-deck/build.sh (limited to 'compass-deck/build.sh') diff --git a/compass-deck/build.sh b/compass-deck/build.sh new file mode 100755 index 0000000..81ed6ff --- /dev/null +++ b/compass-deck/build.sh @@ -0,0 +1,66 @@ +#!/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]%/*} + +yum update -y + +yum --nogpgcheck install -y which python python-devel git wget syslinux amqp mod_wsgi httpd bind rsync yum-utils gcc unzip openssl openssl098e ca-certificates mysql-devel mysql MySQL-python python-virtualenv python-setuptools python-pip bc libselinux-python libffi-devel openssl-devel vim net-tools + +git clone git://git.openstack.org/openstack/compass-web $COMPASS_DIR/../compass-web/ +rm -rf $COMPASS_DIR/../compass-web/.git + +easy_install --upgrade pip +easy_install --upgrade six +pip install --upgrade pip +pip install --upgrade setuptools +pip install --upgrade virtualenv +pip install --upgrade redis +pip install --upgrade virtualenvwrapper + +source `which virtualenvwrapper.sh` +mkvirtualenv --system-site-packages compass-core +workon compass-core +cd /root/compass-deck +pip install -U -r requirements.txt +cd - + +systemctl enable httpd +mkdir -p /var/log/httpd +chmod -R 777 /var/log/httpd +mkdir -p /var/www/compass_web/v2.5 +cp -rf $COMPASS_DIR/../compass-web/v2.5/target/* /var/www/compass_web/v2.5/ + +echo "ServerName compass-deck:80" >> /etc/httpd/conf/httpd.conf +mkdir -p /opt/compass/bin +mkdir -p /opt/compass/db +cp -f $COMPASS_DIR/misc/apache/{ods-server.conf,http_pip.conf,images.conf,packages.conf} \ +/etc/httpd/conf.d/ +cp -rf $COMPASS_DIR/bin/* /opt/compass/bin/ +mkdir -p /var/www/compass +ln -s -f /opt/compass/bin/compass_wsgi.py /var/www/compass/compass.wsgi +cp -rf /usr/lib64/libcrypto.so.6 /usr/lib64/libcrypto.so + +mkdir -p /var/log/compass +chmod -R 777 /var/log/compass +chmod -R 777 /opt/compass/db +mkdir -p $COMPASS_DIR/compass +mv $COMPASS_DIR/{actions,api,apiclient,utils,db,tasks,deployment} $COMPASS_DIR/compass/ +touch $COMPASS_DIR/compass/__init__.py +source `which virtualenvwrapper.sh` +workon compass-core +cd /root/compass-deck +python setup.py install +usermod -a -G root apache + +yum clean all + +cp $COMPASS_DIR/start.sh /usr/local/bin/start.sh +set +x -- cgit 1.2.3-korg