Skip to content

Instantly share code, notes, and snippets.

@klondaiker
Last active August 6, 2021 08:30
Show Gist options
  • Save klondaiker/daec27ca84a7117b71006756a2b30c5a to your computer and use it in GitHub Desktop.
Save klondaiker/daec27ca84a7117b71006756a2b30c5a to your computer and use it in GitHub Desktop.
# Install node with nvm
test ! -f .nvmrc || (
nvm which || \
nvm install
)
# Install ruby with rbenv
set -x
echo 'ruby updater'
test ! -f .ruby-version || (
rbenv --version &&
cat .ruby-version &&
rbenv version &&
((
(rbenv version 2>&1 | grep 'not installed') &&
(echo "Install ruby" && cd ~/.rbenv/plugins/ruby-build && git pull && cd - && rbenv install -s)
) || echo "No need to install")
)
# Install JS packages with yarn
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
test ! -f package.json || \
nvm exec yarn install
# Install Bundler
(~/.rbenv/bin/rbenv exec bundler --version | grep 2.1.4) || \
~/.rbenv/bin/rbenv exec gem install bundler:2.1.4
# Bundle install
test ! -f Gemfile || \
~/.rbenv/bin/rbenv exec bundle install
# GIT
git config --global user.email root@teamcity
git config --global user.name teamcity
# Prepare configs
test -f ./config/database.yml.teamcity && rm -f ./config/database.yml && cp -fv ./config/database.yml.teamcity ./config/database.yml
test -f ./config/secrets.yml.teamcity && rm -f ./config/secrets.yml && cp -fv ./config/secrets.yml.teamcity ./config/secrets.yml
test -f ./config/chewy.yml.teamcity && rm -f ./config/chewy.yml && cp -fv ./config/chewy.yml.teamcity ./config/chewy.yml
# Tests
bundle exec rake parallel:create parallel:load_structure parallel:spec
# Rubocop
bundle exec rubocop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment