diff --git a/.github/workflows/build-solr.yaml b/.github/workflows/build-solr.yaml index f7f4e93..dc3aefc 100644 --- a/.github/workflows/build-solr.yaml +++ b/.github/workflows/build-solr.yaml @@ -3,16 +3,18 @@ run-name: Build Solr of ${{ github.ref_name }} by @${{ github.actor }} on: workflow_dispatch: inputs: - debug_enabled: - type: boolean - description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + debug_step: required: false - default: false + description: 'Pause the selected step to debug using tmate' + type: choice + default: 'build' + options: + - build jobs: build: - uses: notch8/actions/.github/workflows/build.yaml@v1.0.4 + uses: notch8/actions/.github/workflows/build.yaml@v1.0.8 secrets: inherit with: platforms: "linux/amd64" - solrTarget: hyku-solr \ No newline at end of file + solrTarget: hyku-solr diff --git a/.github/workflows/build-test-lint.yaml b/.github/workflows/build-test-lint.yaml index 164524e..fac9063 100644 --- a/.github/workflows/build-test-lint.yaml +++ b/.github/workflows/build-test-lint.yaml @@ -22,23 +22,22 @@ on: jobs: build: - uses: notch8/actions/.github/workflows/build.yaml@v1.0.4 + uses: notch8/actions/.github/workflows/build.yaml@v1.0.8 secrets: inherit with: - platforms: "linux/amd64" webTarget: hyku-web workerTarget: hyku-worker test: needs: build - uses: notch8/actions/.github/workflows/test.yaml@v1.0.4 + uses: notch8/actions/.github/workflows/test.yaml@v1.0.8 with: confdir: '/app/samvera/hyrax-webapp/solr/conf' rspec_cmd: "cd .. && gem install semaphore_test_boosters && bundle && rspec_booster --job $CI_NODE_INDEX/$CI_NODE_TOTAL" lint: needs: build - uses: notch8/actions/.github/workflows/lint.yaml@v1.0.4 + uses: notch8/actions/.github/workflows/lint.yaml@v1.0.8 with: webTarget: hyku-web workerTarget: hyku-worker diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index a73a5c4..5ae66ff 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -10,7 +10,7 @@ on: type: choice options: - friends - debug_enabled: + debug_step: type: boolean description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' required: false @@ -18,5 +18,5 @@ on: jobs: deploy: - uses: notch8/actions/.github/workflows/deploy.yaml@v1.0.4 + uses: notch8/actions/.github/workflows/deploy.yaml@v1.0.8 secrets: inherit diff --git a/bin/deploy-hykudev.sh b/bin/deploy-hykudev.sh new file mode 100755 index 0000000..e07fd4f --- /dev/null +++ b/bin/deploy-hykudev.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail + +## Instructions: +## 0. Alias was already created and persisted at ~/.bashrc: +## alias dc='dotenv -e .env.development docker-compose' +## 1. Connect to WVU VPN via The Windows App +## 2. Connect via PuTTY to hykudev server: hykudev.lib.wvu.edu with your user name +## 3. Switch to ansible: sudo su - ansible +## 4. cd wvu_knapsack +## 5. git pull origin main (or branch name) +## 6. ./bin/deploy_hykudev.sh + +echo "Updating submodules..." +git submodule sync --recursive +git submodule update --init --recursive + +echo "Stopping and cleaning up old containers..." +docker compose down --remove-orphans + +echo "Pulling Docker images..." +TAG="$(git rev-parse --short=8 HEAD)" dotenv -e .env.development docker compose pull + +echo "Building and starting containers..." +TAG="$(git rev-parse --short=8 HEAD)" dotenv -e .env.development docker compose up -d web + +echo "Deploy complete. Containers are now running image tagged" +echo "" +echo "Admin Tenant: https://hykudev-admin.lib.wvu.edu" +echo "Default Tenant: https://hykudev.lib.wvu.edu" \ No newline at end of file diff --git a/bin/submodule-update.sh b/bin/submodule-update.sh deleted file mode 100755 index 09c7f32..0000000 --- a/bin/submodule-update.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Hyku Submodule Setup Script -# -# Usage: -# bin/submodule_update.sh # Use latest main -# bin/submodule_update.sh abcdef12 # Use a specific commit SHA -# bin/submodule_update.sh v1.2.3 # Use a tag -# bin/submodule_update.sh my-feature # Use a branch - -TARGET_REF="${1:-}" - -# Ensure submodule is initialized -git submodule update --init hyrax-webapp - -cd hyrax-webapp - -if [[ -n "$TARGET_REF" ]]; then - echo "Checking out specified ref: $TARGET_REF" - git fetch origin - git checkout "$TARGET_REF" -else - echo "Checking out latest main" - git checkout main - git pull origin main -fi - -# Get short SHA for tagging -BASE_TAG=$(git rev-parse --short=8 HEAD) -cd .. - -# Write BASE_TAG to .env (which docker-compose auto-loads) -echo "Setting BASE_TAG=$BASE_TAG in .env" - -touch .env -if grep -q '^BASE_TAG=' .env; then - # Replace existing BASE_TAG line safely - awk -v new_tag="BASE_TAG=$BASE_TAG" ' - BEGIN { updated=0 } - /^BASE_TAG=/ { print new_tag; updated=1; next } - { print } - END { if (!updated) print new_tag } - ' .env > .env.tmp && mv .env.tmp .env -else - echo "BASE_TAG=$BASE_TAG" >> .env -fi - - -echo "BASE_TAG written to .env" -echo -echo "Setup complete. You can now run:" -echo " docker compose build" \ No newline at end of file diff --git a/deploy-hykudev.sh b/deploy-hykudev.sh deleted file mode 100755 index 4cef32f..0000000 --- a/deploy-hykudev.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -set -e - -## Instructions: -## 1. Connect to WVU VPN via The Windows App -## 2. SSH into the VM: ssh user_name@hykudev.lib.wvu.edu -## 3. Switch to ansible: sudo su - ansible -## 4. cd wvu_knapsack -## 5. ./deploy_hykudev.sh [optional-branch-name] - - - -echo "๐Ÿ“ Switching to project root..." -cd /home/ansible/wvu_knapsack - -BRANCH="${1:-$(git rev-parse --abbrev-ref HEAD)}" -echo "๐Ÿ“Œ Using branch: $BRANCH" - -if [ "$BRANCH" != "main" ]; then - echo "๐Ÿ”„ Pulling latest code from 'main'..." - git pull origin main - echo "๐Ÿ”„ Also pulling latest code from branch '$BRANCH'..." - git pull origin "$BRANCH" -else - echo "๐Ÿ”„ Pulling latest code from 'main'..." - git pull origin main -fi - -echo "๐Ÿ“ฆ Updating submodules..." -git submodule update --remote - -echo "๐Ÿท๏ธ Updating TAG to latest commit SHA..." -TAG=$(git rev-parse --short=8 HEAD) - -# Check the .env for a TAG and delete it then add new TAG -sed -i '/^TAG=/d' /home/ansible/wvu_knapsack/.env.development -echo "TAG=$TAG" >> /home/ansible/wvu_knapsack/.env.development -export TAG -echo "Tag is: $TAG" - -echo "๐Ÿงน Stopping and cleaning up old containers..." -docker compose down --remove-orphans - -echo "๐Ÿ”„ Resetting Gemfile.lock and m3_profile.yaml to match repository..." -cd /home/ansible/wvu_knapsack/hyrax-webapp -git restore Gemfile.lock config/metadata_profiles/m3_profile.yaml -cd .. - -echo "๐Ÿณ Pulling latest Docker images..." -docker compose pull - -echo "๐Ÿš€ Recreating containers from latest image..." -docker compose build -docker compose up -d - -echo "โœ… Deploy complete. Containers are now running image tagged: $TAG" -echo "" -echo "๐Ÿ”— Admin Tenant: https://hykudev-admin.lib.wvu.edu" -echo "๐Ÿ”— Default Tenant: https://hykudev.lib.wvu.edu" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 9458462..7072198 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -79,6 +79,8 @@ services: extends: file: hyrax-webapp/docker-compose.yml service: web + ports: + - "127.0.0.1:3000:3000" # Uncomment command to access container with out starting bin/web. Useful for debugging or updating Gemfile.lock # command: sleep infinity diff --git a/hyrax-webapp b/hyrax-webapp index 9e2525a..d950398 160000 --- a/hyrax-webapp +++ b/hyrax-webapp @@ -1 +1 @@ -Subproject commit 9e2525a1d9a2a5257831493f30f1a435069af4bf +Subproject commit d950398d1c5f93590552defee1c5c62f112ddd51 diff --git a/lib/blacklight_advanced_search/render_constraints_override_decorator.rb b/lib/blacklight_advanced_search/render_constraints_override_decorator.rb index 7dc2226..3ce1921 100644 --- a/lib/blacklight_advanced_search/render_constraints_override_decorator.rb +++ b/lib/blacklight_advanced_search/render_constraints_override_decorator.rb @@ -11,4 +11,14 @@ def render_constraints_filters(params_or_search_state = search_state) end end -BlacklightAdvancedSearch::RenderConstraintsOverride.prepend(BlacklightAdvancedSearch::RenderConstraintsOverrideDecorator) +if defined?(BlacklightAdvancedSearch::RenderConstraintsOverride) + # blacklight_advanced_search <= 7 (old hook point) + BlacklightAdvancedSearch::RenderConstraintsOverride.prepend( + BlacklightAdvancedSearch::RenderConstraintsOverrideDecorator + ) +elsif defined?(Blacklight::RenderConstraintsHelperBehavior) + # blacklight_advanced_search 8+ (RenderConstraintsOverride removed/renamed) + Blacklight::RenderConstraintsHelperBehavior.prepend( + BlacklightAdvancedSearch::RenderConstraintsOverrideDecorator + ) +end