Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 44 lines (36 sloc) 1.26 KB
#!/bin/bash
WORKSPACE=${WORKSPACE:-${PWD}}
# prevent fail in gentoo
unset RUBYOPT
if [[ -d /Applications && ! -x /usr/local/bin/brew ]]; then
echo ">>> Installing homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo ">>> Installing libraries"
brew install libxml2 libxslt coreutils gnupg2
fi
if [[ ! -e "${HOME}"/.rvm/scripts/rvm ]]; then
echo ">>> Installing RVM"
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -s -L -k https://get.rvm.io -o /tmp/rvm-installer || exit 1
chmod +x /tmp/rvm-installer || exit 1
/tmp/rvm-installer latest || exit 1
rm -f /tmp/rvm-installer || exit 1
fi
echo ">>> Loading RVM environment"
export rvm_autoupdate_flag=0
if [[ -e "$HOME/.rvm/scripts/rvm" ]]; then
source "$HOME/.rvm/scripts/rvm" || exit 1
elif [[ -e /usr/local/rvm/scripts/rvm ]]; then
source /usr/local/rvm/scripts/rvm
else
echo "RVM cannot be found"
exit 1
fi
echo ">>> Installing Ruby"
rvm install --quiet $(<${WORKSPACE}/.ruby-version) --verify-downloads 2 2>/dev/null || exit 1
rvm use $(<${WORKSPACE}/.ruby-version) >/dev/null || exit 1
echo ">>> Installing bundle"
if ! type -P bundle >/dev/null; then
gem install bundler || exit 1
fi
bundle install --quiet || exit 1