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
7 changes: 4 additions & 3 deletions .github/workflows/lint-test-build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -22,4 +24,3 @@ jobs:
contents: read
packages: write
secrets: inherit

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

Expand All @@ -14,9 +14,9 @@
# 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

Expand Down Expand Up @@ -50,7 +50,7 @@

RUN chown -R nginx:nginx /var/www/ojs

ENV \

Check warning on line 53 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-push / build-ubuntu-24.04

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OJS_ADMIN_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 53 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-push / build-ubuntu-24.04

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OJS_SECRET_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 53 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-push / build-ubuntu-24.04

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OJS_API_KEY_SECRET") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 53 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-push / build-ubuntu-24.04

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "DB_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 53 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-push / build-ubuntu-24.04-arm

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OJS_SECRET_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 53 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-push / build-ubuntu-24.04-arm

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OJS_API_KEY_SECRET") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 53 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-push / build-ubuntu-24.04-arm

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "DB_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 53 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-push / build-ubuntu-24.04-arm

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "OJS_ADMIN_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
DB_HOST=mariadb \
DB_PORT=3306 \
DB_NAME=ojs \
Expand Down
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
21 changes: 21 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -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 "<img" | grep -q "Open Journal Systems"; then
echo "OJS is up!"
exit 0
fi
done

echo "Failed to detect OJS after $max_attempts attempts"
exit 1