realms-wiki/install.sh

66 lines
1.4 KiB
Bash
Raw Normal View History

2014-09-02 17:29:04 +03:00
#!/bin/bash
# Provision script created for Ubuntu 14.04
2014-09-04 06:25:48 +03:00
APP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2014-09-02 17:29:04 +03:00
if [ -d "/vagrant" ]; then
# Control will enter here if $DIRECTORY exists.
APP_DIR="/vagrant"
fi
2014-09-02 17:29:04 +03:00
echo "Provisioning..."
sudo apt-get update
sudo apt-get install -y software-properties-common python-software-properties
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get update
2014-10-07 00:07:20 +03:00
sudo apt-get install -y python build-essential pkg-config git \
python-pip python-virtualenv python-dev zlib1g-dev \
2014-10-07 00:07:20 +03:00
libffi-dev libyaml-dev libssl-dev nodejs
2014-09-02 17:29:04 +03:00
# lxml deps
# libxml2-dev libxslt1-dev
2014-09-02 17:29:04 +03:00
# Default cache is memoization
# Redis
# add-apt-repository -y chris-lea/redis-server
# add-apt-repository -y chris-lea/python-redis
# apt-get update
# apt-get install -y redis-server
# Default DB is sqlite
# Mysql
# apt-get install -y mysql-server mysql-client
# MariaDB
# apt-get install -y mariadb-server mariadb-client
# Postgres
# apt-get install -y postgresql postgresql-contrib
# Install frontend assets
sudo npm install -g bower
2014-09-02 17:29:04 +03:00
2014-11-07 00:28:19 +02:00
cd /home/vagrant
virtualenv .venv
source .venv/bin/activate
2014-11-07 00:28:19 +02:00
cd /vagrant
bower --config.interactive=false install
pip install -r requirements.txt
2014-09-02 17:29:04 +03:00
echo "Installing start scripts"
2014-11-07 00:28:19 +02:00
cat << EOF > /tmp/realms-wiki
#!/bin/bash
2014-11-07 00:28:19 +02:00
/home/vagrant/.venv/bin/realms-wiki "\$@"
EOF
2014-11-07 00:28:19 +02:00
sudo mv /tmp/realms-wiki /usr/local/bin
sudo chmod +x /usr/local/bin/realms-wiki
realms-wiki start