Skip to content

Commit

Permalink
Merge pull request #101 from mlibrary/2023-11-06-updates
Browse files Browse the repository at this point in the history
November 2023 dependency updates.
  • Loading branch information
niquerio authored Nov 6, 2023
2 parents e86d886 + bf13fd9 commit d0c0635
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .github/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ rubyfiles=$(git diff --cached --name-only --diff-filter=ACM "*.rb" "Gemfile" |

# Standardize all ruby files
echo "🧹 Formatting staged Ruby files using standardrb ($(echo $rubyfiles | wc -w | awk '{print $1}') total)"
echo "$rubyfiles" | xargs docker-compose run --rm web bundle exec standardrb --fix
echo "$rubyfiles" | xargs docker compose run -T --rm web bundle exec standardrb --fix

# Add back the modified/prettified files to staging
echo "$rubyfiles" | xargs git add

echo "📋 Running tests with rspec"
docker-compose run --rm web bundle exec rspec --format progress
docker compose run --rm -T web bundle exec rspec --format progress

exit 0
14 changes: 14 additions & 0 deletions .github/workflows/build-deploy-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ jobs:
dockerfile: Dockerfile
secrets: inherit

scan-image:
needs: build-production
runs-on: ubuntu-latest
steps:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.release.tag_name }}
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'

deploy-production:
needs: build-production
runs-on: ubuntu-latest
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ jobs:
dockerfile: Dockerfile
secrets: inherit

scan-image:
needs: build-unstable
runs-on: ubuntu-latest
steps:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ needs.build-unstable.outputs.image }}
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'

deploy-testing:
needs: build-unstable
runs-on: ubuntu-latest
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/manual-deploy-unstable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ jobs:
tag: ${{ github.event.inputs.tag }}
dockerfile: Dockerfile
secrets: inherit

scan-image:
needs: build-unstable
runs-on: ubuntu-latest
steps:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ needs.build-unstable.outputs.image }}
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'

deploy:
needs: build-unstable
Expand Down
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ GEM
specs:
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
anyway_config (2.5.3)
anyway_config (2.5.4)
ruby-next-core (>= 0.14.0)
ast (2.4.2)
base64 (0.1.1)
Expand Down Expand Up @@ -38,7 +38,7 @@ GEM
parser (3.2.2.4)
ast (~> 2.4.1)
racc
prometheus-client (4.2.1)
prometheus-client (4.2.2)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand All @@ -48,7 +48,7 @@ GEM
public_suffix (5.0.3)
puma (6.4.0)
nio4r (~> 2.0)
racc (1.7.1)
racc (1.7.3)
rack (2.2.8)
rack-protection (3.1.0)
rack (~> 2.2, >= 2.2.4)
Expand All @@ -58,7 +58,7 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.8.1)
regexp_parser (2.8.2)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
Expand All @@ -85,7 +85,7 @@ GEM
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
Expand All @@ -110,18 +110,18 @@ GEM
rack-protection (= 3.1.0)
sinatra (= 3.1.0)
tilt (~> 2.0)
standard (1.31.1)
standard (1.31.2)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.56.2)
rubocop (~> 1.56.4)
standard-custom (~> 1.0.0)
standard-performance (~> 1.2)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.2.0)
standard-performance (1.2.1)
lint_roller (~> 1.1)
rubocop-performance (~> 1.19.0)
rubocop-performance (~> 1.19.1)
tilt (2.3.0)
unicode-display_width (2.5.0)
webmock (3.19.1)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ edit .env with the appropriate environment variables
start containers

```bash
docker-compose up -d
docker compose up -d
```

Run the tests
```
docker-compose run web bundle exec rspec
docker compose run web bundle exec rspec
```
In a browser go to http://localhost:4567/callnumber?query=UM1

Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml → compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.8'

services:
web:
build:
Expand Down
8 changes: 4 additions & 4 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ else
fi

echo "🚢 Build docker images"
docker-compose build
docker compose build

echo "📦 Installing Gems"
docker-compose run --rm web bundle
docker compose run --rm web bundle

echo "📦 Installing Node modules"
docker-compose run --rm web npm install
docker compose run --rm web npm install

echo "📦 Building js and css"
docker-compose run --rm web npm run build
docker compose run --rm web npm run build
73 changes: 38 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d0c0635

Please sign in to comment.