From 9749cb50c2ad21c2a6d4b6b9ab39097b989f7eb9 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Fri, 10 Oct 2014 14:59:37 -0300 Subject: [PATCH] simplify deployment of development environment --- .mrconfig | 2 +- Vagrantfile | 7 +++++++ dev-install.sh | 38 -------------------------------------- vagrant.sh | 8 ++++++++ 4 files changed, 16 insertions(+), 39 deletions(-) create mode 100755 vagrant.sh diff --git a/.mrconfig b/.mrconfig index 8fb1562..612c504 100644 --- a/.mrconfig +++ b/.mrconfig @@ -1,7 +1,7 @@ [.] [colab] -checkout = git clone https://github.com/colab-community/colab.git --branch master +checkout = git clone https://github.com/colab-community/colab.git --branch pypi [mailman-api] checkout = git clone https://github.com/TracyWebTech/mailman-api.git diff --git a/Vagrantfile b/Vagrantfile index f06604f..302f341 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,4 +6,11 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "centos6" + + proxy = ENV['http_proxy'] || ENV['HTTP_PROXY'] + if proxy + config.vm.provision 'shell', path: 'proxy.sh', args: [proxy] + end + + config.vm.provision 'shell', path: 'vagrant.sh' end diff --git a/dev-install.sh b/dev-install.sh index a925843..05dfd44 100755 --- a/dev-install.sh +++ b/dev-install.sh @@ -2,42 +2,4 @@ set -e -vagrant up -if [ -z "$http_proxy" ]; then - http_proxy=$(vagrant ssh -- sh -c '. /etc/profile.d/http_proxy.sh 2>/dev/null; echo $http_proxy') -fi - -if [ -z "$http_proxy" ]; then - printf "HTTP Proxy[none]: " - read http_proxy -fi - -if [ -n "$http_proxy" ]; then - vagrant ssh -- sudo /vagrant/proxy.sh $http_proxy - export http_proxy -fi - -host=$(vagrant ssh-config | awk '{ if ($1 == "HostName") { print($2) }}') -port=$(vagrant ssh-config | awk '{ if ($1 == "Port") { print($2) }}') -key=$(vagrant ssh-config | awk '{ if ($1 == "IdentityFile") { print($2) }}') - -cat > colab/environments.json </dev/null || sudo apt-get install -qy fabric - -( - cd colab - fab --disable-known-hosts bootstrap - fab --disable-known-hosts deploy -) diff --git a/vagrant.sh b/vagrant.sh new file mode 100755 index 0000000..aa1e42a --- /dev/null +++ b/vagrant.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e +cd /vagrant + +# colab +sh ./colab/vagrant/bootstrap.sh +sh ./colab/vagrant/provision.sh -- libgit2 0.21.2