Commit 5ccb540ae228371d7a511b52ea81a115e98994e0
1 parent
36934121
Exists in
master
and in
39 other branches
Added new shell provisioners
For now ubuntu only
Showing
3 changed files
with
61 additions
and
0 deletions
Show diff stats
Vagrantfile
... | ... | @@ -24,11 +24,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
24 | 24 | |
25 | 25 | if distro == "precise64" |
26 | 26 | colab.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box" |
27 | + config.vm.provision "shell", path: "vagrant/ubuntu.sh" | |
27 | 28 | elsif distro == "trusty64" |
28 | 29 | colab.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" |
30 | + config.vm.provision "shell", path: "vagrant/ubuntu.sh" | |
29 | 31 | elsif distro == "centos6.5" |
30 | 32 | colab.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box" |
33 | + config.vm.provision "shell", path: "vagrant/centos.sh" | |
31 | 34 | end |
35 | + config.vm.provision "shell", privileged: false, keep_color: true, path: "vagrant/provision.sh" | |
32 | 36 | |
33 | 37 | colab.vm.network :forwarded_port, guest: 8000, host: 8000 # Colab (runserver) |
34 | 38 | colab.vm.network :forwarded_port, guest: 5280, host: 5280 # BOSH server | ... | ... |
... | ... | @@ -0,0 +1,18 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | +source /usr/local/bin/virtualenvwrapper.sh | |
4 | + | |
5 | +if [ ! -d /home/vagrant/.virtualenvs/colab ]; then | |
6 | + mkvirtualenv colab | |
7 | +fi | |
8 | + | |
9 | +workon colab | |
10 | + | |
11 | +pip install -r /vagrant/requirements.txt | |
12 | +pip install -e /vagrant | |
13 | + | |
14 | +if [ ! -f /etc/colab/settings.yaml ]; then | |
15 | + colab-init-config > /etc/colab/settings.yaml | |
16 | +fi | |
17 | + | |
18 | +colab-admin migrate | ... | ... |
... | ... | @@ -0,0 +1,39 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | +UBUNTU=$(lsb_release -sc) | |
4 | + | |
5 | +if [[ $UBUNTU == 'precise' ]] | |
6 | +then | |
7 | + postgresql_pkg='postgresql-9.1' | |
8 | +elif [[ $UBUNTU == 'trusty' ]] | |
9 | +then | |
10 | + postgresql_pkg='postgresql-9.3' | |
11 | +fi | |
12 | + | |
13 | + | |
14 | +### Install dependencies | |
15 | +apt-get update | |
16 | + | |
17 | +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_pkg -y | |
18 | + | |
19 | + | |
20 | +### Install Virtualenvwrapper | |
21 | +which pip2.7 > /dev/null || | |
22 | + curl -s -L https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | | |
23 | + python2.7 | |
24 | + | |
25 | +if [ ! -L /etc/bash_completion.d/virtualenvwrapper.sh ] | |
26 | +then | |
27 | + pip install virtualenvwrapper | |
28 | + ln -s /usr/local/bin/virtualenvwrapper.sh /etc/bash_completion.d/virtualenvwrapper.sh | |
29 | +fi | |
30 | + | |
31 | +### Create conf directory | |
32 | +mkdir -p /etc/colab | |
33 | +chown vagrant:vagrant /etc/colab | |
34 | + | |
35 | +### Create colab user in PostgreSQL | |
36 | +echo "CREATE USER colab WITH PASSWORD 'colab';" | sudo -u postgres -i psql 2> /dev/null || echo | |
37 | + | |
38 | +#i## Create colab DB in PostgreSQL | |
39 | +sudo -u postgres -i createdb --owner=colab colab 2> /dev/null | echo | ... | ... |