Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gem dependencies that have security risks #298

Merged
merged 2 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ jobs:
command: |
curl -sSL "https://nodejs.org/dist/v14.15.0/node-v14.15.0-linux-x64.tar.xz" | sudo tar --strip-components=2 -xJ -C /usr/local/bin/ node-v14.15.0-linux-x64/bin/node
curl https://www.npmjs.com/install.sh | sudo bash
- run:
name: "Configure Bundler"
command: |
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
source $BASH_ENV
gem install bundler
- restore_cache:
keys:
- v1-bundler-{{ checksum "Gemfile.lock" }}
Expand All @@ -43,6 +49,12 @@ jobs:
<<: *defaults
steps:
- checkout
- run:
name: "Configure Bundler"
command: |
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
source $BASH_ENV
gem install bundler
- restore_cache:
keys:
- v1-bundler-{{ checksum "Gemfile.lock" }}
Expand All @@ -61,6 +73,12 @@ jobs:
command: |
curl -sSL "https://nodejs.org/dist/v14.15.0/node-v14.15.0-linux-x64.tar.xz" | sudo tar --strip-components=2 -xJ -C /usr/local/bin/ node-v14.15.0-linux-x64/bin/node
curl https://www.npmjs.com/install.sh | sudo bash
- run:
name: "Configure Bundler"
command: |
echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
source $BASH_ENV
gem install bundler
Comment on lines +76 to +81
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to add this run step in each job, install_dependencies, run_checks, and run_tests. If not, bundler v1 would be used and the job would fail.

I'm not really familiar with CircleCI config code, is there a way to define this once for all three jobs to use? So that this code can be DRY?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coltborg I believe that yes, you can define it once and reuse it for all three jobs. I think the GYR circle CI config has examples of defining a command and reusing it.

- restore_cache:
keys:
- v1-bundler-{{ checksum "Gemfile.lock" }}
Expand Down
Loading