diff --git a/.github/workflows/lint-test-build-push.yaml b/.github/workflows/lint-test-build-push.yaml index e40d8bf..9c857c2 100644 --- a/.github/workflows/lint-test-build-push.yaml +++ b/.github/workflows/lint-test-build-push.yaml @@ -11,9 +11,11 @@ jobs: steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - - uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0 + - uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0 - - run: shellcheck **/*.sh + - run: make lint + + - run: make test build-push: needs: [lint-test] @@ -22,4 +24,3 @@ jobs: contents: read packages: write secrets: inherit - diff --git a/Dockerfile b/Dockerfile index f97bcab..950f0c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM islandora/nginx:6.0.1@sha256:20d8b36e812c60bfabccdbfbee0f40d46733df921a4ea9de0a2fa943f88f4fb5 +FROM islandora/nginx:6.0.4@sha256:b6511d412d3b249c4091c2e586912db1305fbe4e3536316fb6c19e1f86766de1 SHELL ["/bin/ash", "-eo", "pipefail", "-c"] @@ -14,9 +14,9 @@ ARG \ # renovate: datasource=repology depName=alpine_3_22/npm NPM_VERSION=11.3.0-r1 \ # renovate: datasource=github-tags depName=ojs packageName=pkp/ojs - OJS_VERSION=3_5_0-1 \ + OJS_VERSION=3_5_0rc2 \ # renovate: datasource=repology depName=alpine_3_22/php83 - PHP_VERSION=8.3.26-r0 \ + PHP_VERSION=8.3.27-r0 \ # renovate: datasource=repology depName=alpine_3_22/poppler-utils POPPLER_VERSION=25.04.0-r0 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d6bc751 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +.PHONY: build deps lint run test + +DOCKER_IMAGE=ghcr.io/libops/ojs:main + +deps: + docker compose pull + +build: deps + docker compose build + +lint: + @docker compose config --format json| jq -e .services.ojs.image | grep libops + @if command -v hadolint > /dev/null 2>&1; then \ + echo "Running hadolint on Dockerfiles..."; \ + find . -name "Dockerfile" | xargs hadolint; \ + else \ + echo "hadolint not found, skipping Dockerfile validation"; \ + fi + @if command -v json5 > /dev/null 2>&1; then \ + echo "Running json5 validation on renovate.json5"; \ + json5 --validate renovate.json5 > /dev/null; \ + else \ + echo "json5 not found, skipping renovate validation"; \ + fi + + +run: build + docker compose up init + docker compose up -d + +test: run + ./scripts/test.sh diff --git a/docker-compose.yaml b/docker-compose.yaml index f809713..6f52998 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -21,7 +21,7 @@ secrets: services: init: - image: islandora/base:6.0.1@sha256:34c281449a339dbce75f784da7dca237a3325022868d89ab5cf6d6d8e0ca24a1 + image: islandora/base:6.0.4@sha256:71a42ef7d1676e50a5860ac44fdde705fd0b38af0a7006c9d3371b8d88d0e311 restart: no volumes: - ./secrets:/secrets:rw @@ -53,7 +53,7 @@ services: mariadb: condition: service_started mariadb: - image: islandora/mariadb:6.0.1@sha256:335df4225634f14095b337847e541d65b5abfa2fe051c7e2b93fae447cac1e58 + image: islandora/mariadb:6.0.4@sha256:0394daa3f0d99d8dde5c273da4f55b340b76fc729dfdc8b8466155ecc486235a volumes: - mariadb-data:/var/lib/mysql:rw secrets: diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 0000000..d052162 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eou pipefail + +max_attempts=10 +attempt=0 + +while [ $attempt -lt $max_attempts ]; do + attempt=$(( attempt + 1 )) + echo "Attempt $attempt of $max_attempts..." + + sleep 60 + + if curl -sf http://localhost | grep "