diff --git a/vagrant/centos.sh b/vagrant/centos.sh new file mode 100644 index 0000000..311286e --- /dev/null +++ b/vagrant/centos.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +### Add PUIAS repo + +yum install curl -y + +if [ ! -f /etc/pki/rpm-gpg/RPM-GPG-KEY-puias ]; then + curl -s http://www.math.ias.edu/data/puias/6/i386/os/RPM-GPG-KEY-puias > /etc/pki/rpm-gpg/RPM-GPG-KEY-puias +fi + +if [ ! -f /etc/yum.repos.d/puias-6-core.repo ]; then + 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 + + rpm -i --nodeps http://springdale.math.ias.edu/data/puias/6/x86_64/os/Packages/springdale-core-6-2.sdl6.10.noarch.rpm +fi + +if [ ! -f /etc/yum.repos.d/puias-6-computational.repo ]; then + yum install springdale-computational -y +fi + + +### Install dependencies + +yum -y groupinstall "Development tools" + +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 + +### Install Virtualenvwrapper +which pip2.7 > /dev/null || + curl -s -L https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | + python2.7 + +if [ ! -f /etc/profile.d/virtualenvwrapper.sh ] +then + pip install virtualenvwrapper + cat > "/etc/profile.d/virtualenvwrapper.sh" < /var/lib/pgsql/data/pg_hba.conf + echo "host all colab ::1/128 md5" >> /var/lib/pgsql/data/pg_hba.conf + service postgresql initdb &> /dev/null + service postgresql restart +fi + + +### Create colab user in PostgreSQL +echo "CREATE USER colab WITH PASSWORD 'colab';" | sudo -u postgres -i psql 2> /dev/null || echo + +#i## Create colab DB in PostgreSQL +sudo -u postgres -i createdb --owner=colab colab 2> /dev/null | echo diff --git a/vagrant/provision.sh b/vagrant/provision.sh index d876d4d..11c813a 100644 --- a/vagrant/provision.sh +++ b/vagrant/provision.sh @@ -1,6 +1,12 @@ #!/bin/bash -source /usr/local/bin/virtualenvwrapper.sh +export VIRTUALENVWRAPPER_PYTHON="/usr/bin/python2.7" + +if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then + source /usr/local/bin/virtualenvwrapper.sh +else + source /usr/bin/virtualenvwrapper.sh +fi if [ ! -d /home/vagrant/.virtualenvs/colab ]; then mkvirtualenv colab @@ -11,7 +17,7 @@ workon colab pip install -r /vagrant/requirements.txt pip install -e /vagrant -if [ ! -f /etc/colab/settings.yaml ]; then +if [ ! -s /etc/colab/settings.yaml ]; then colab-init-config > /etc/colab/settings.yaml fi -- libgit2 0.21.2