summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authormo k <mo.khan@gmail.com>2014-10-31 20:32:46 -0600
committermo k <mo.khan@gmail.com>2014-10-31 20:32:46 -0600
commitebc71d94acc9658c46a068a1bf7ae11abee1d6bc (patch)
tree7854ae45ef9079b8807c1f73169585ce0e7a058e /script
parent38da80374b5fdd471696d5e6994c0826a3add2ec (diff)
parent3215ca4a46db0f95e8b9bfc9693e2dffaa49b2c0 (diff)
Merged in mocheen/cakeside/vagrant (pull request #116)
update vagrant provisioner to include latest packages and build db.
Diffstat (limited to 'script')
-rw-r--r--script/bootstrap-vagrant-user.sh24
-rw-r--r--script/bootstrap.sh34
2 files changed, 38 insertions, 20 deletions
diff --git a/script/bootstrap-vagrant-user.sh b/script/bootstrap-vagrant-user.sh
new file mode 100644
index 00000000..60708c8f
--- /dev/null
+++ b/script/bootstrap-vagrant-user.sh
@@ -0,0 +1,24 @@
+git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
+echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
+echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
+source ~/.bash_profile
+git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
+git clone https://github.com/tpope/rbenv-ctags.git ~/.rbenv/plugins/rbenv-ctags
+git clone https://github.com/rkh/rbenv-update.git ~/.rbenv/plugins/rbenv-update
+git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
+rbenv update
+rbenv install 2.1.4
+rbenv global 2.1.4
+gem install bundler --no-ri --no-rdoc
+rbenv rehash
+cd /vagrant
+bundle install -j 4
+rbenv rehash
+if [ ! -f config/database.yml ]; then
+ ln -s config/database.yml.vagrant config/database.yml
+fi
+if [ ! -f .env ]; then
+ ln -s .env.example .env
+fi
+bundle exec rake db:create db:migrate db:seed
+RAILS_ENV=test bundle exec rake db:create db:migrate db:seed
diff --git a/script/bootstrap.sh b/script/bootstrap.sh
index f71edc3b..ce6d3838 100644
--- a/script/bootstrap.sh
+++ b/script/bootstrap.sh
@@ -1,40 +1,34 @@
#!/usr/bin/env bash
-
apt-get update -y
apt-get upgrade -y
apt-get -y install curl git-core python-software-properties imagemagick libmagickwand-dev memcached
apt-get -y install build-essential
apt-get -y install tklib
-# Extras for RubyGems and Rails:
apt-get -y install zlib1g-dev libssl-dev
-# Readline Dev on Ubuntu 12.04 LTS:
apt-get -y install libreadline-gplv2-dev
-# Install some nokogiri dependencies:
apt-get -y install libxml2 libxml2-dev libxslt1-dev
apt-get -y install gawk libreadline6-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev
+apt-get -y install build-essential
+apt-get -y install tklib
+apt-get -y install zlib1g-dev libssl-dev
+apt-get -y install libreadline-gplv2-dev
+apt-get -y install libxml2 libxml2-dev libxslt1-dev
+apt-get -y install curl libcurl3 libcurl3-gnutls libcurl4-openssl-dev
apt-get -y autoremove
+
add-apt-repository -y ppa:nginx/stable
apt-get -y update
apt-get -y install nginx
+
add-apt-repository -y ppa:pitti/postgresql
apt-get -y update
-apt-get -y install postgresql-9.3 libpq-dev
+apt-get -y install postgresql-9.3 libpq-dev postgresql-contrib-9.3
+
add-apt-repository -y ppa:chris-lea/node.js
apt-get -y update
apt-get -y install nodejs
-apt-get -y install build-essential
-# Packages required for compilation of some stdlib modules
-apt-get -y install tklib
-# Extras for RubyGems and Rails:
-apt-get -y install zlib1g-dev libssl-dev
-# Readline Dev on Ubuntu 12.04 LTS:
-apt-get -y install libreadline-gplv2-dev
-# Install some nokogiri dependencies:
-apt-get -y install libxml2 libxml2-dev libxslt1-dev
-git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
-echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
-echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
-source ~/.bash_profile
-git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
-rbenv install 2.1.3
+su postgres<<EOF
+createuser -s -e -w vagrant
+EOF
+su -c "source /vagrant/script/bootstrap-vagrant-user.sh" vagrant