Commit 70e66881f8c7014deef4885d08aca69d8b65202d

Authored by Sergio Oliveira
1 parent 9c0fc2b4

Refactored vagrant install scripts

vagrant/centos.sh
... ... @@ -15,53 +15,16 @@ if [ -n "$http_proxy" ]; then
15 15 fi
16 16 fi
17 17  
18   -### Install dependencies
19   -
20   -yum -y groupinstall "Development tools"
21   -
22   -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 python-devel postgresql-server java epel-release
23 18  
24   -### Install Rabbitmq
25   -yum install -y rabbitmq-server
26   -systemctl start rabbitmq-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   - service postgresql initdb
50   - cp /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf.bkp
51   - echo "local all all ident" > /var/lib/pgsql/data/pg_hba.conf
52   - echo "host all all 127.0.0.1/32 md5" >> /var/lib/pgsql/data/pg_hba.conf
53   - echo "host all all ::1/128 md5" >> /var/lib/pgsql/data/pg_hba.conf
54   - service postgresql restart
55   -fi
  19 +### Install dependencies
56 20  
  21 +yum install -y epel-release
57 22  
58   -### Create colab user in PostgreSQL
59   -echo "CREATE USER colab WITH PASSWORD 'colab';" | sudo -u postgres -i psql 2> /dev/null || echo
60   -echo "ALTER USER colab CREATEDB;" | sudo -u postgres -i psql 2> /dev/null
  23 +yum -y groupinstall "Development tools"
61 24  
62   -### Create colab DB in PostgreSQL
63   -sudo -u postgres -i createdb --owner=colab colab 2> /dev/null | echo
  25 +yum install -y git unzip gettext libxml2-devel libxslt-devel openssl-devel libffi-devel python-devel python-pip python-virtualenvwrapper rabbitmq-server
64 26  
65   -### Forcing postgresql to start at boot
66   -sudo chkconfig postgresql on
67 27  
  28 +### Init Rabbitmq
  29 +chkconfig rabbitmq-server on
  30 +systemctl start rabbitmq-server
... ...
vagrant/provision.sh
... ... @@ -31,6 +31,10 @@ for dir in /vagrant/colab /vagrant; do
31 31 done
32 32 pip install -e $basedir
33 33  
  34 +### Create conf directory
  35 +sudo mkdir -p /etc/colab
  36 +sudo chown vagrant:vagrant /etc/colab
  37 +
34 38 if [ ! -s /etc/colab/settings.py ]; then
35 39 colab-init-config > /etc/colab/settings.py
36 40 fi
... ... @@ -41,4 +45,4 @@ colab-admin loaddata /vagrant/tests/test_data.json
41 45 # Init.d Celery files
42 46 sudo cp $basedir/vagrant/misc/etc/init.d/celeryd /etc/init.d/
43 47 sudo cp $basedir/vagrant/misc/etc/default/celeryd /etc/default/
44   -sudo systemctl start celeryd
  48 +sudo service celeryd start
... ...
vagrant/ubuntu.sh
... ... @@ -5,16 +5,4 @@ set -ex
5 5 ### Install dependencies
6 6 apt-get update
7 7  
8   -apt-get install curl git unzip mercurial build-essential libev-dev gettext libxml2-dev libxslt1-dev libssl-dev libffi-dev libjpeg-dev zlib1g-dev libfreetype6-dev libpq-dev python-dev postgresql virtualenvwrapper python-pip java-common -y
9   -
10   -
11   -### Create conf directory
12   -mkdir -p /etc/colab
13   -chown vagrant:vagrant /etc/colab
14   -
15   -### Create colab user in PostgreSQL
16   -echo "CREATE USER colab WITH PASSWORD 'colab';" | sudo -u postgres -i psql 2> /dev/null || echo
17   -echo "ALTER USER colab CREATEDB;" | sudo -u postgres -i psql 2> /dev/null
18   -
19   -#i## Create colab DB in PostgreSQL
20   -sudo -u postgres -i createdb --owner=colab colab 2> /dev/null | echo
  8 +apt-get install curl git unzip build-essential gettext libxml2-dev libxslt1-dev libssl-dev libffi-dev python-dev virtualenvwrapper python-pip rabbitmq-server -y
... ...