install.rst 1.51 KB
Newer Older
1 2 3
Install
=========

Őry Máté committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
[ ! -e "$SSH_AUTH_SOCK" ] && echo "Please forward the SSH agent." && exit 1
# rabbitmq does not work with hostnames beginning w numbers
hostname=$(hostname)
case "$hostname" in
    [0-9]*)
    sudo tee /etc/hostname <<< c$hostname
    sudo hostname c$hostname
    sudo sed -i /etc/hosts -e "s/$hostname/c$hostname/g"
esac
sudo apt-get update
sudo apt-get install --yes virtualenvwrapper postgresql git \
    python-pip rabbitmq-server libpq-dev python-dev
sudo sed -i /etc/postgresql/9.1/main/postgresql.conf -e '/#listen_addresses/ s/^#//'
sudo /etc/init.d/postgresql restart
sudo sed -i /etc/ssh/sshd_config -e '$ a AcceptEnv GIT_*'
sudo /etc/init.d/ssh reload
sudo -u postgres createuser -S -D -R circle
sudo -u postgres psql <<<"ALTER USER circle WITH PASSWORD 'circle';"
sudo -u postgres createdb circle -O circle
source /etc/bash_completion.d/virtualenvwrapper
git clone -b ng git@git.cloud.ik.bme.hu:circle/cloud.git circle
mkvirtualenv circle
cat >>/home/cloud/.virtualenvs/circle/bin/postactivate <<A
export DJANGO_SETTINGS_MODULE=circle.settings.local
export DJANGO_DB_HOST=localhost
export DJANGO_DB_PASSWORD=circle
export DJANGO_FIREWALL_SETTINGS='{"dns_ip": "152.66.243.60", "dns_hostname":
            "localhost", "dns_ttl": "300", "reload_sleep": "10",
            "rdns_ip": "152.66.243.60", "default_vlangroup": "publikus"}'
A
workon circle
cd ~/circle
pip install -r requirements/local.txt
circle/manage.py syncdb --migrate --noinput
circle/manage.py createsuperuser --username=test --email=test@example.org