Last active
January 12, 2019 20:25
-
-
Save criess/80984bbe27da77f447079aa5810d79dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
export BUILD_DIR=$(pwd) | |
export RBENV_ROOT="$BUILD_DIR/.rbenv" | |
if [ ! -d .rbenv ]; then | |
git clone https://github.com/rbenv/rbenv.git .rbenv | |
git clone https://github.com/rbenv/ruby-build.git .rbenv/plugins/ruby-build | |
else | |
cd $RBENV_ROOT | |
git pull | |
cd $RBENV_ROOT/plugins/ruby-build | |
git pull | |
fi | |
cd $BUILD_DIR | |
export PATH="$RBENV_ROOT/bin:$PATH" | |
eval "$(rbenv init -)" | |
RUBY_INSTALLED=$(rbenv versions | cut -c3-8 | grep -E "^2\.5\.3$") | |
if [ -z $RUBY_INSTALLED ]; then | |
rbenv install 2.5.3 | |
fi | |
ssh-keyscan github.com >> /root/.ssh/known_hosts | |
rm -rf dev-api | |
git clone --single-branch --branch develop git@github.com:carlfin/api.git dev-api | |
echo "2.5.3" > "dev-api/.ruby_version" | |
cd $BUILD_DIR/dev-api | |
gem install bundler -v '1.17.3' | |
bundle install | |
bundle exec rails --help | |
# stdin and stdout detach (possibly for rails server?) | |
#</dev/null &>/dev/null & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment