Xicheng Chang fa5f106bf6 Revert "Retire stackforge/compass-install"
This reverts commit 2614e5fa95aab680fb6f9287831e50c65f76f72c.

The repository is actually maintained, the authors merely
misunderstood the stackforge namespace retirement maintenance
announcements[1] and didn't realize they needed to notify us of that
status. Reverting the repository to its former state in preparation
for a namespace move in a coming project rename maintenance.

[1] http://lists.openstack.org/pipermail/openstack-infra/2015-August/003119.html

Change-Id: I6ccdcd8f8a084711c265e42c77b3b4159af27b24
2015-11-03 17:37:20 -08:00

57 lines
1.6 KiB
Bash

#!/bin/bash
# set python home
# sed -i "s|\$PythonHome|\/root\/\.virtualenvs\/compass-core|g" /opt/compass/bin/switch_virtualenv.py
# add apache to root user group
# usermod -a -G `groups root|awk '{print$3}'` apache
# activate virtualenv
source `which virtualenvwrapper.sh`
workon compass-core
## mysql
# install db
# grant permission to mysql data dir
# /usr/bin/mysql_install_db
# chown mysql:mysql /var/lib/mysql
# chown mysql:mysql /var/lib/mysql/*
# chown mysql:mysql /var/lib/mysql/mysql/*
# chown mysql:mysql /var/lib/mysql/performance_schema/*
# start mysqld service, push it to bg
/usr/bin/mysqld_safe > /dev/null 2>&1 &
RET=1
while [[ RET -ne 0 ]]; do
echo "waiting for mariadb to startup"
sleep 5
mysql -uroot -e "status" > /dev/null 2>&1
RET=$?
done
echo "mariadb started"
# set mysql with default username and password
mysqladmin -h127.0.0.1 --port=3306 -u root password root
# create db 'compass'
mysql -h127.0.0.1 --port=3306 -uroot -proot -e "create database compass"
## virtualenv
# create virtualenv
# source `which virtualenvwrapper.sh`
# mkvirtualenv --system-site-packages compass-core
# install compass requirements
# start compass services
/opt/compass/bin/manage_db.py createdb
/usr/sbin/apachectl -k start
/usr/sbin/rabbitmq-server &
/usr/bin/redis-server &
ln -s /root/.virtualenvs/compass-core/bin/celery /opt/compass/bin/celery
CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper C_FORCE_ROOT=1 /opt/compass/bin/celery worker &> /tmp/celery-worker.log &
/opt/compass/bin/progress_update.py &> /tmp/progress_update.log &
tail -f /dev/null