Upgrading Ruby - TISTATechnologies/caseflow GitHub Wiki
The following represents how we upgraded from Ruby 2.5.3 to 2.7.3. This can be used as a framework for future upgrades.
Steps taken to upgrade/get PR ready
-
Updated version numbers in config files
.circleci/config.yml
.ruby-version
Dockerfile
ci-bin/circle_docker_container/Dockerfile
ci-bin/circle_docker_container/build_and_push.sh
-
Updated circle
config.yml
to installbundler
based on version that is in lock file:
- run:
name: Configure Bundler
command: |
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
source $BASH_ENV
gem install bundler
- Ran through local upgrade commands:
brew update && brew upgrade ruby-build && rbenv install 2.7.3
gem install bundler
bundle update --bundler
-
- Build/push new docker image from
ci-bin/circle_docker_container/Dockerfile
. Commands:
mfa XXXXXX aws ecr get-login-password --region us-gov-west-1 | docker login --username AWS --password-stdin 008577686731.dkr.ecr.us-gov-west-1.amazonaws.com # following commands ran from ci-bin/circle_docker_container aws s3 cp s3://shared-s3/dsva-appeals/instant-client-12-1.tar.gz instant-client-12-1.tar.gz tar xvzf instant-client-12-1.tar.gz rm instant-client-12-1.tar.gz docker build -t circleci . docker tag circleci:latest 008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/circleci:2.7.3-node-browsers docker push 008577686731.dkr.ecr.us-gov-west-1.amazonaws.com/circleci:2.7.3-node-browsers
- Build/push new docker image from
After merge, to get dev env up to date
Anyone that doesn't have 2.7 installed locally will have to run the following:
rbenv install
gem install bundler -v 2.2.19
make install
Steps needed to get the continer used in Caseflow Demo working
- Update the base image to ruby:2.7.3-slim
- The default version's of
bundler
andrake
were in conflict with theGemfile.lock
and needed to be changed in the Dockerfile- Install the
bundler
version used inGemfile.lock
- Rake 13.0.1 is already installed, so we're uninstalling it and letting bundler install rake later.
- Install the
gem install bundler:$(cat Gemfile.lock | tail -1 | tr -d " ")
gem uninstall -i /usr/local/lib/ruby/gems/2.7.0 rake