Last active
August 22, 2018 15:12
-
-
Save bushong1/5fbb65c27e4356c1cff320ea2fde0695 to your computer and use it in GitHub Desktop.
Update Gemfile.lock using Docker without Ruby installed locally
This file contains hidden or 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
#!/bin/bash | |
if [ ! -f ./Gemfile.lock ]; then | |
# No Gemfile.lock present, create a new one | |
touch Gemfile.lock | |
fi | |
if [ -f ./.ruby-version ]; then | |
ruby_version="$(cat .ruby-version)" | |
else | |
ruby_version="latest" | |
fi | |
docker run \ | |
--mount type=bind,source="$(pwd)/Gemfile",target=/Gemfile \ | |
--mount type=bind,source="$(pwd)/Gemfile.lock",target=/Gemfile.lock \ | |
ruby:${ruby_version} \ | |
bundle lock --update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment