Skip to content

Commit

Permalink
Merge pull request #519 from psu-libraries/preview/update-ruby
Browse files Browse the repository at this point in the history
preview/update ruby
  • Loading branch information
whereismyjetpack authored Sep 22, 2022
2 parents 8a99bb6 + d7aa52f commit 1e1d2ec
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 24 deletions.
35 changes: 19 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
docker: circleci/docker@1.5.0
docker: circleci/docker@2.1.2

jobs:
release:
Expand Down Expand Up @@ -29,18 +29,29 @@ jobs:
user: root
steps:
- setup_remote_docker:
version: 19.03.13
version: 20.10.14
- checkout
- docker/check:
registry: harbor.k8s.libraries.psu.edu
- docker/build:
cache_from: harbor.k8s.libraries.psu.edu/library/myaccount:cache
image: library/myaccount
registry: harbor.k8s.libraries.psu.edu
use-buildkit: true
tag: "cache,$CIRCLE_SHA1"
extra_build_args: "--target production"
- docker/build:
cache_from: harbor.k8s.libraries.psu.edu/library/myaccount:ci
image: library/myaccount
registry: harbor.k8s.libraries.psu.edu
use-buildkit: true
tag: ci
extra_build_args: "--target ci"
- docker/push:
digest-path: /tmp/digest.txt
image: library/myaccount
registry: harbor.k8s.libraries.psu.edu
tag: "$CIRCLE_SHA1,ci,cache"
- run:
command: |
echo "Digest is: $(</tmp/digest.txt)"
Expand All @@ -60,18 +71,15 @@ jobs:
./bin/generate_app
test:
docker:
- image: circleci/ruby:2.6.5-buster-node-browsers
- image: redis:5.0.7
- image: harbor.k8s.libraries.psu.edu/library/myaccount:ci
- image: redis:7.0.4-alpine3.16
environment:
RAILS_ENV: test
steps:
- checkout
- restore_cache:
keys:
- bundle-{{ checksum "Gemfile.lock" }}
- run:
name: "Wait for Redis"
command: dockerize -wait tcp://localhost:6379 -timeout 1m
- bundle-{{ checksum "Gemfile.lock" }}-v3
- run:
name: "Bundle"
command: |
Expand All @@ -80,16 +88,16 @@ jobs:
- save_cache:
paths:
- vendor/bundle
key: bundle-{{ checksum "Gemfile.lock" }}
key: bundle-{{ checksum "Gemfile.lock" }}-v3
- restore_cache:
keys:
- yarn-{{ checksum "yarn.lock" }}
- yarn-{{ checksum "yarn.lock" }}-v3
- run:
name: "Yarn"
command: |
yarn install --cache-folder ~/.cache/yarn --frozen-lockfile
- save_cache:
key: yarn-{{ checksum "yarn.lock" }}
key: yarn-{{ checksum "yarn.lock" }}-v3
paths:
- ~/.cache/yarn
- run:
Expand Down Expand Up @@ -131,11 +139,6 @@ workflows:
- publish:
context:
- org-global
filters:
branches:
only:
- main
- /preview\/.*/
- deploy:
context:
- org-global
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ inherit_from:

AllCops:
NewCops: enable
TargetRubyVersion: 2.6.5
TargetRubyVersion: 2.7.6
Exclude:
- 'bin/**/*'
- 'db/**/*'
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM harbor.k8s.libraries.psu.edu/library/ruby-2.6.5-node-12:20220901 as base
FROM harbor.k8s.libraries.psu.edu/library/ruby-2.7.6-node-12:20220725 as base
ARG UID=2000
WORKDIR /app
RUN useradd -u $UID app -d /app
Expand All @@ -25,7 +25,7 @@ RUN RAILS_ENV=production \
CMD ["/app/bin/start"]


FROM base as test
FROM base as ci

USER root
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
Expand All @@ -43,6 +43,8 @@ RUN apt-get update && apt-get install -y x11vnc \

USER app

FROM ci as test

RUN bundle

CMD ["sleep", "99999999"]
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.5'
ruby '2.7.6'

gem 'bootsnap', '>= 1.4.4', require: false
gem 'config', '~> 2.0'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ DEPENDENCIES
webpacker

RUBY VERSION
ruby 2.6.5p114
ruby 2.7.6

BUNDLED WITH
2.1.4
2 changes: 1 addition & 1 deletion app/helpers/fines_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module FinesHelper
def fine_title_display(fine: fine)
def fine_title_display(fine:)
(render BibItemComponent.new(bibitem: fine) unless fine.catkey.nil?) || fine.title
end
end
2 changes: 1 addition & 1 deletion app/jobs/application_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def symphony_client
@symphony_client || SymphonyClient.new
end

def badge(message: message, badge_class: 'success')
def badge(message:, badge_class: 'success')
ApplicationController.renderer.render(
partial: 'shared/badge',
locals: { message: message, badge_class: badge_class }
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.5'
services:
redis:
image: redis:6.0.6-alpine3.12
image: redis:7.0.4-alpine3.16
volumes:
- redis-data:/data
ports:
Expand Down

0 comments on commit 1e1d2ec

Please sign in to comment.