Commit 358f30b7b517e2fb8d467db86c03be00abc25ae4
1 parent
5ccb540a
Exists in
master
and in
39 other branches
Added CentOS provision
Showing
2 changed files
with
69 additions
and
2 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | +#!/bin/bash | |
| 2 | + | |
| 3 | +### Add PUIAS repo | |
| 4 | + | |
| 5 | +yum install curl -y | |
| 6 | + | |
| 7 | +if [ ! -f /etc/pki/rpm-gpg/RPM-GPG-KEY-puias ]; then | |
| 8 | + curl -s http://www.math.ias.edu/data/puias/6/i386/os/RPM-GPG-KEY-puias > /etc/pki/rpm-gpg/RPM-GPG-KEY-puias | |
| 9 | +fi | |
| 10 | + | |
| 11 | +if [ ! -f /etc/yum.repos.d/puias-6-core.repo ]; then | |
| 12 | + rpm -i --nodeps http://springdale.math.ias.edu/data/puias/6/x86_64/os/Packages/springdale-release-6-6.5.0.45.sdl6.3.x86_64.rpm --replacefiles | |
| 13 | + | |
| 14 | + rpm -i --nodeps http://springdale.math.ias.edu/data/puias/6/x86_64/os/Packages/springdale-core-6-2.sdl6.10.noarch.rpm | |
| 15 | +fi | |
| 16 | + | |
| 17 | +if [ ! -f /etc/yum.repos.d/puias-6-computational.repo ]; then | |
| 18 | + yum install springdale-computational -y | |
| 19 | +fi | |
| 20 | + | |
| 21 | + | |
| 22 | +### Install dependencies | |
| 23 | + | |
| 24 | +yum -y groupinstall "Development tools" | |
| 25 | + | |
| 26 | +yum install -y git unzip mercurial libev-devel gettext libxml2-devel libxslt-devel openssl-devel libffi-devel libjpeg-turbo-devel zlib-devel freetype-devel postgresql-devel python27 python27-devel postgresql-server | |
| 27 | + | |
| 28 | +### Install Virtualenvwrapper | |
| 29 | +which pip2.7 > /dev/null || | |
| 30 | + curl -s -L https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | | |
| 31 | + python2.7 | |
| 32 | + | |
| 33 | +if [ ! -f /etc/profile.d/virtualenvwrapper.sh ] | |
| 34 | +then | |
| 35 | + pip install virtualenvwrapper | |
| 36 | + cat > "/etc/profile.d/virtualenvwrapper.sh" <<EOF | |
| 37 | +export VIRTUALENVWRAPPER_PYTHON="/usr/bin/python2.7" | |
| 38 | +source /usr/bin/virtualenvwrapper.sh | |
| 39 | +EOF | |
| 40 | +fi | |
| 41 | + | |
| 42 | +### Create conf directory | |
| 43 | +mkdir -p /etc/colab | |
| 44 | +chown vagrant:vagrant /etc/colab | |
| 45 | + | |
| 46 | + | |
| 47 | +## Configuring postgres | |
| 48 | +if [ ! -f /var/lib/pgsql/data/pg_hba.conf.bkp ]; then | |
| 49 | + cp /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf.bkp | |
| 50 | + echo "host all colab 127.0.0.1/32 md5" > /var/lib/pgsql/data/pg_hba.conf | |
| 51 | + echo "host all colab ::1/128 md5" >> /var/lib/pgsql/data/pg_hba.conf | |
| 52 | + service postgresql initdb &> /dev/null | |
| 53 | + service postgresql restart | |
| 54 | +fi | |
| 55 | + | |
| 56 | + | |
| 57 | +### Create colab user in PostgreSQL | |
| 58 | +echo "CREATE USER colab WITH PASSWORD 'colab';" | sudo -u postgres -i psql 2> /dev/null || echo | |
| 59 | + | |
| 60 | +#i## Create colab DB in PostgreSQL | |
| 61 | +sudo -u postgres -i createdb --owner=colab colab 2> /dev/null | echo | ... | ... |
vagrant/provision.sh
| 1 | 1 | #!/bin/bash |
| 2 | 2 | |
| 3 | -source /usr/local/bin/virtualenvwrapper.sh | |
| 3 | +export VIRTUALENVWRAPPER_PYTHON="/usr/bin/python2.7" | |
| 4 | + | |
| 5 | +if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then | |
| 6 | + source /usr/local/bin/virtualenvwrapper.sh | |
| 7 | +else | |
| 8 | + source /usr/bin/virtualenvwrapper.sh | |
| 9 | +fi | |
| 4 | 10 | |
| 5 | 11 | if [ ! -d /home/vagrant/.virtualenvs/colab ]; then |
| 6 | 12 | mkvirtualenv colab |
| ... | ... | @@ -11,7 +17,7 @@ workon colab |
| 11 | 17 | pip install -r /vagrant/requirements.txt |
| 12 | 18 | pip install -e /vagrant |
| 13 | 19 | |
| 14 | -if [ ! -f /etc/colab/settings.yaml ]; then | |
| 20 | +if [ ! -s /etc/colab/settings.yaml ]; then | |
| 15 | 21 | colab-init-config > /etc/colab/settings.yaml |
| 16 | 22 | fi |
| 17 | 23 | ... | ... |