Skip to content
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
24 changes: 24 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Example .env file for dspace-containerization
# Copy to .env and adjust as needed.
#
# GITHUB_BRANCH: branch name in the mlibrary forks of DSpace and dspace-angular
# used to build the shared source image (Dockerfile).
# NOTE: this variable is only used locally (Makefile / docker build). In GitHub
# Actions CI the same value is stored as SOURCE_BRANCH to avoid the reserved
# GITHUB_* prefix, then forwarded as --build-arg GITHUB_BRANCH=${SOURCE_BRANCH}.
# DSPACE_VERSION: version tag suffix used by DSpace Docker Hub images (e.g. 7.6 → dspace-7.6).
# Target version: 7.6.6 (Dec 2025). See the repository build and deployment documentation.
# JDK_VERSION: Java version for the backend Tomcat image (17 required).
# DSPACE_UI_HOST: hostname the Angular SSR server binds to AND uses in server-side URLs.
# Use 0.0.0.0 for Docker local dev (Node.js 18+ resolves 'localhost' to ::1 which breaks
# Docker port-mapping). Set to the public hostname for staging/production deployments.
# DSPACE_REST_HOST: hostname the Angular SSR server uses to reach the backend REST API.
# Use 'backend' (Docker service name) for local dev so the SSR server (running inside the
# frontend container) can reach the backend over Docker internal DNS.
# Browser-side Angular re-uses the dspaceServer URL from the HAL root at runtime.
GITHUB_BRANCH=umich
DSPACE_VERSION=7.6
JDK_VERSION=17
DSPACE_UI_HOST=0.0.0.0
DSPACE_REST_HOST=backend

24 changes: 0 additions & 24 deletions .github/workflows/branch-scratch.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/build-apache-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ jobs:
if: github.repository == 'mlibrary/dspace-containerization'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6.0.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v4.0.0

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v4.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push dspace-apache image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7.1.0
with:
context: .
push: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-apache-uid-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ jobs:
if: github.repository == 'mlibrary/dspace-containerization'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6.0.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v4.0.0

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v4.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push dspace-apache:uid image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7.1.0
with:
context: .
push: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-db-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ jobs:
if: github.repository == 'mlibrary/dspace-containerization'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6.0.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v4.0.0

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v4.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push dspace-db image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7.1.0
with:
context: .
push: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-db-uid-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ jobs:
if: github.repository == 'mlibrary/dspace-containerization'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6.0.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v4.0.0

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v4.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push dspace-db:uid image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7.1.0
with:
context: .
push: true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-dspace-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ jobs:
if: github.repository == 'mlibrary/dspace-containerization'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6.0.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v4.0.0

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v4.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push dspace-solr image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7.1.0
with:
context: .
push: true
Expand All @@ -53,7 +53,7 @@ jobs:
SOURCE_IMAGE_TAG=${{ github.event.inputs.source_image_tag }}

- name: Build and push dspace-backend image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7.1.0
with:
context: .
push: true
Expand All @@ -64,7 +64,7 @@ jobs:
SOURCE_IMAGE_TAG=${{ github.event.inputs.source_image_tag }}

- name: Build and push dspace-frontend image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7.1.0
timeout-minutes: 20
with:
context: .
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-dspace-uid-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ jobs:
if: github.repository == 'mlibrary/dspace-containerization'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6.0.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v4.0.0

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v4.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push dspace-solr:uid image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7.1.0
with:
context: .
push: true
Expand All @@ -53,7 +53,7 @@ jobs:
UID=${{ github.event.inputs.uid }}

- name: Build and push dspace-backend:uid image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7.1.0
with:
context: .
push: true
Expand All @@ -64,7 +64,7 @@ jobs:
UID=${{ github.event.inputs.uid }}

- name: Build and push dspace-frontend:uid image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7.1.0
with:
context: .
push: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-express-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ jobs:
if: github.repository == 'mlibrary/dspace-containerization'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6.0.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v4.0.0

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v4.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push dspace-express image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7.1.0
with:
context: .
push: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-source-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ jobs:
if: github.repository == 'mlibrary/dspace-containerization'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v6.0.2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v4.0.0

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v4.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push dspace-source image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v7.1.0
with:
context: .
push: true
Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
name: CI

# Triggers:
# 1. Push to main — post-merge validation on the canonical branch.
# 2. Pull-requests targeting main — runs on every push to a PR branch so
# the merge result is validated before it lands. Because this covers
# PR branches via the pull_request event, the push trigger is scoped to
# main only; this avoids double-running the job when a PR branch is
# pushed (which would fire both push and pull_request events).
# NOTE: feature branches that have no open PR targeting main will NOT
# receive CI until a PR is opened.
# 3. Manual trigger with optional version overrides (workflow_dispatch).
#
# NOTE: "umich" here is the SOURCE_BRANCH build arg — the default branch
# in the mlibrary/DSpace and mlibrary/dspace-angular forks from which
# source code is cloned when building images. It is NOT a branch of this
# repository. In those forks, "umich" is the canonical development branch
# and always pulls from "main" (which tracks upstream official DSpace);
# it never pushes back to "main".
#
# NOTE: env vars that start with GITHUB_ are reserved by the GitHub Actions
# runner and will cause the workflow to fail if set in an env: block.
# The source-branch variable is therefore named SOURCE_BRANCH, and is passed
# to `docker build` as --build-arg GITHUB_BRANCH=... so that the Dockerfile
# and Makefile need no changes.
#
# NOTE: docker/setup-buildx-action is intentionally NOT used here.
# That action switches to the `docker-container` Buildx driver, which runs
# builds in an isolated container that cannot see images stored in the local
# Docker daemon. As a result `docker compose build` fails to resolve
# `dspace-containerization-source` (a local-only base image) and tries to
# pull it from Docker Hub, which does not exist. The default `docker` driver
# (used when no setup-buildx-action step is present) shares the daemon image
# store, so the source image built in step 1 is immediately available to
# `docker compose build` in step 2.
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
Comment thread
gkostin1966 marked this conversation as resolved.
Comment thread
gkostin1966 marked this conversation as resolved.
workflow_dispatch:
inputs:
dspace_version:
description: "DSpace Version (e.g. 7.6)"
required: false
default: "7.6"
jdk_version:
description: "JDK Version (17 recommended)"
required: false
default: "17"
source_branch:
description: "Source branch in mlibrary forks"
required: false
default: "umich"

jobs:
smoke-test:
name: Smoke tests – DSpace ${{ github.event.inputs.dspace_version || '7.6' }}
runs-on: ubuntu-latest
# Only run for the canonical repository; avoids wasting runner minutes on forks.
if: github.repository == 'mlibrary/dspace-containerization'

env:
# SOURCE_BRANCH replaces the former GITHUB_BRANCH (reserved prefix).
SOURCE_BRANCH: ${{ github.event.inputs.source_branch || 'umich' }}
DSPACE_VERSION: ${{ github.event.inputs.dspace_version || '7.6' }}
JDK_VERSION: ${{ github.event.inputs.jdk_version || '17' }}
BACKEND_URL: http://localhost:8080
SOLR_URL: http://localhost:8983
FRONTEND_URL: http://localhost:4000
MAX_WAIT: "900"

steps:
- name: Checkout
uses: actions/checkout@v6.0.2


# ── Build ──────────────────────────────────────────────────────────────
# The source image MUST be built before `docker compose build` because
# backend/solr/frontend dockerfiles reference `dspace-containerization-source`
# with a FROM instruction. Docker cannot pull this local-only image from
# Docker Hub and will otherwise fail with "pull access denied".
- name: Build shared source image
run: |
docker build -t dspace-containerization-source \
--build-arg GITHUB_BRANCH=${SOURCE_BRANCH} \
.

- name: Build compose service images
run: |
docker compose build

# ── Start ──────────────────────────────────────────────────────────────
- name: Start core services
run: docker compose up -d

# ── Wait ───────────────────────────────────────────────────────────────
- name: Wait for stack to be ready
run: bash tests/wait-for-stack.sh

# ── Test ───────────────────────────────────────────────────────────────
- name: Run smoke tests
run: bash tests/smoke.sh

# ── Debug (always runs, even on failure) ───────────────────────────────
- name: Dump service logs on failure
if: failure()
run: docker compose logs --no-color
Loading