Skip to content

Commit

Permalink
Merge pull request #5683 from avalonmediasystem/staging
Browse files Browse the repository at this point in the history
Release 7.7! 🎉
  • Loading branch information
cjcolvar authored Feb 20, 2024
2 parents d37bc17 + a72bc72 commit eb51ca5
Show file tree
Hide file tree
Showing 750 changed files with 12,113 additions and 23,708 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
build:
docker:
# Primary container image where all steps run.
- image: avalonmediasystem/avalon:7.5.0-dev-ruby3
- image: avalonmediasystem/avalon:develop
environment:
- DATABASE_URL=postgresql://postgres@localhost:5432/postgres
- FEDORA_URL=http://localhost:8080/fcrepo/rest
Expand All @@ -21,7 +21,7 @@ jobs:
environment:
CATALINA_OPTS: '-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC'
- image: zookeeper:3.4
- image: solr:8-slim
- image: solr:9
environment:
VERBOSE: yes
SECURITY_JSON: '{"authentication":{"blockUnknown": false, "class":"solr.BasicAuthPlugin", "credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="}, "realm":"My Solr users", "forwardCredentials": false}, "authorization":{ "class":"solr.RuleBasedAuthorizationPlugin", "permissions":[{"name":"security-edit", "role":"admin"}], "user-role":{"solr":"admin"}}}'
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
fi
zip -1 -r solr_conf.zip ./*
curl -H "Content-type:application/octet-stream" --data-binary @solr_conf.zip "http://solr:SolrRocks@127.0.0.1:<< parameters.solr_port >>/solr/admin/configs?action=UPLOAD&name=solrconfig"
curl -H 'Content-type: application/json' http://solr:SolrRocks@127.0.0.1:<< parameters.solr_port >>/api/collections/ -d '{create: {name: << parameters.core_name >>, config: solrconfig, numShards: 1}}'
curl "http://solr:SolrRocks@127.0.0.1:<< parameters.solr_port >>/solr/admin/collections?action=CREATE&name=hydra-test&numShards=1&collection.configName=solrconfig"
- run:
command: |
Expand All @@ -113,11 +113,11 @@ jobs:

# Pull in the parallel_rspec step and modify it to ensure that test results get stored
# - samvera/parallel_rspec
- run: mkdir /tmp/test-results
- run:
name: Run rspec in parallel
command: |
mkdir /tmp/test-results
bundle exec rspec --format progress --format RspecJunitFormatter -o /tmp/test-results/rspec.xml $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
circleci tests glob "spec/**/*_spec.rb" | circleci tests run --command="xargs bundle exec rspec --format progress --format RspecJunitFormatter -o /tmp/test-results/rspec.xml" --verbose --split-by=timings
# collect reports
- store_test_results:
path: /tmp/test-results
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/podman-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Builds image and stores in ghcr.io then sends webhook to deploy new image
name: Podman Image CI

on:
push:
branches: [ "main", "staging", "develop", "sandbox" ]

env:
GHCR_USER: ${{ github.actor }}
GHCR_PASSWORD: ${{ github.token }}
GHCR_IMAGE_REGISTRY: ghcr.io/avalonmediasystem
DOCKERHUB_IMAGE_REGISTRY: docker.io/avalonmediasystem
DOCKERHUB_USER: ${{ secrets.dockerhub_user }}
DOCKERHUB_PASSWORD: ${{ secrets.dockerhub_password }}
IMAGE_TAG: ${{ fromJSON('{"refs/heads/main":"production","refs/heads/develop":"develop","refs/heads/staging":"staging","refs/heads/sandbox":"sandbox"}')[github.ref] }}
BRANCH: ${{ fromJSON('{"refs/heads/main":"main","refs/heads/develop":"develop","refs/heads/staging":"staging","refs/heads/sandbox":"sandbox"}')[github.ref] }}
BUILD_TARGET: ${{ fromJSON('{"refs/heads/main":"prod","refs/heads/develop":"dev","refs/heads/staging":"prod","refs/heads/sandbox":"prod"}')[github.ref] }}

jobs:

build:
runs-on: ubuntu-latest

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: false
- uses: actions/checkout@v3
- name: Determine DockerHub image tags
id: determine_dockerhub_tags
run: |
AVALON_VERSION=`script/avalon_image_tags.rb -t`
echo "AVALON_VERSION=${AVALON_VERSION}" >> "$GITHUB_OUTPUT"
if [ $IMAGE_TAG = 'develop' ]; then
AVALON_TAGS=`script/avalon_image_tags.rb --branch ${BRANCH} -a ${AVALON_VERSION}-dev | awk 'gsub(","," ")'`
elif [ $IMAGE_TAG = 'production' ]; then
AVALON_TAGS=`script/avalon_image_tags.rb -s -t -a latest | awk 'gsub(","," ")'`
else
AVALON_TAGS=""
fi
echo "tags=${AVALON_TAGS}" >> "$GITHUB_OUTPUT"
echo "Will pushing to DockerHub with tags: ${AVALON_TAGS}"
- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@v2
with:
image: avalon
tags: ${{ env.IMAGE_TAG }} ${{ github.sha }} ${{ steps.determine_dockerhub_tags.outputs.tags }}
containerfiles: ./Dockerfile
oci: true
extra-args: --target ${{ env.BUILD_TARGET }}
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ env.IMAGE_TAG }} ${{ github.sha }}
registry: ${{ env.GHCR_IMAGE_REGISTRY }}
username: ${{ env.GHCR_USER }}
password: ${{ env.GHCR_PASSWORD }}
extra-args: |
--disable-content-trust
- name: Push To Dockerhub
if: ${{ steps.determine_dockerhub_tags.outputs.tags != '' }}
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.determine_dockerhub_tags.outputs.tags }}
registry: ${{ env.DOCKERHUB_IMAGE_REGISTRY }}
username: ${{ env.DOCKERHUB_USER }}
password: ${{ env.DOCKERHUB_PASSWORD }}
extra-args: |
--disable-content-trust
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ LABEL project=avalon
RUN echo "deb http://ftp.us.debian.org/debian/ bullseye main contrib non-free" > /etc/apt/sources.list.d/bullseye.list \
&& echo "deb-src http://ftp.us.debian.org/debian/ bullseye main contrib non-free" >> /etc/apt/sources.list.d/bullseye.list \
&& cat /etc/apt/sources.list.d/bullseye.list \
&& apt-get update && apt-get install -y --no-install-recommends curl gnupg2 ffmpeg \
&& curl -sL http://deb.nodesource.com/setup_14.x | bash - \
&& mkdir -p /etc/apt/keyrings \
&& apt-get update && apt-get install -y --no-install-recommends curl ca-certificates gnupg2 ffmpeg \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& cat /etc/apt/sources.list.d/nodesource.list \
Expand Down Expand Up @@ -111,7 +113,7 @@ RUN bundle config set --local without 'development test' \


# Install node modules
FROM node:12-bullseye-slim as node-modules
FROM node:20-bullseye-slim as node-modules
LABEL stage=build
LABEL project=avalon
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates
Expand All @@ -131,7 +133,6 @@ COPY --from=node-modules --chown=app:app /node_modules ./node_modules
USER app
ENV RAILS_ENV=production

RUN SECRET_KEY_BASE=$(ruby -r 'securerandom' -e 'puts SecureRandom.hex(64)') bundle exec rake webpacker:compile
RUN SECRET_KEY_BASE=$(ruby -r 'securerandom' -e 'puts SecureRandom.hex(64)') bundle exec rake assets:precompile
RUN cp config/controlled_vocabulary.yml.example config/controlled_vocabulary.yml

Expand Down
15 changes: 9 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ gem 'react-rails'
gem 'sass', '3.4.22'
gem 'sprockets-es6'
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
gem 'uglifier', '>= 1.3.0'
gem 'webpacker'
gem 'terser'
gem 'shakapacker'

# Core Samvera
gem 'active-fedora', '~> 14.0', '>= 14.0.1'
Expand All @@ -49,11 +49,11 @@ gem 'active_annotations', '~> 0.4'
gem 'activerecord-session_store', '>= 2.0.0'
gem 'acts_as_list'
gem 'api-pagination'
gem 'avalon-about', git: 'https://github.com/avalonmediasystem/avalon-about.git', tag: 'avalon-r6.4'
gem 'avalon-about', git: 'https://github.com/avalonmediasystem/avalon-about.git', tag: 'avalon-r7.7'
#gem 'bootstrap-sass', '< 3.4.1' # Pin to less than 3.4.1 due to change in behavior with popovers
gem 'bootstrap-toggle-rails'
gem 'bootstrap_form'
gem 'iiif_manifest', '~> 1.3'
gem 'iiif_manifest', '>= 1.4.0'
gem 'rack-cors', require: 'rack/cors'
gem 'rails_same_site_cookie'
gem 'recaptcha', require: 'recaptcha/rails'
Expand All @@ -74,11 +74,10 @@ gem 'omniauth-lti', git: "https://github.com/avalonmediasystem/omniauth-lti.git"
gem "omniauth-saml", "~> 2.0"

# Media Access & Transcoding
gem 'active_encode', '~> 1.0', '>= 1.1.3'
gem 'active_encode', '>= 1.2.2'
gem 'audio_waveform-ruby', '~> 1.0.7', require: 'audio_waveform'
gem 'browse-everything', git: "https://github.com/avalonmediasystem/browse-everything.git", branch: 'v1.2-avalon'
gem 'fastimage'
gem 'media_element_add_to_playlist', git: 'https://github.com/avalonmediasystem/media-element-add-to-playlist.git', tag: 'avalon-r6.5'
gem 'mediainfo', git: "https://github.com/avalonmediasystem/mediainfo.git", tag: 'v0.7.1-avalon'
gem 'rest-client', '~> 2.0'
gem 'roo'
Expand All @@ -103,6 +102,10 @@ gem 'jbuilder', '~> 2.0'
gem 'parallel'
gem 'with_locking'

# Reindexing script
gem 'sequel'
gem 'httpx'

group :development do
gem 'capistrano', '~>3.6'
gem 'capistrano-passenger', require: false
Expand Down
Loading

0 comments on commit eb51ca5

Please sign in to comment.