Skip to content
Open
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
13 changes: 13 additions & 0 deletions tests/Dockerfile.verify_mdb_properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ghcr.io/graalvm/native-image-community:21

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN microdnf install -y curl findutils git grep sed unzip which \
&& microdnf clean all

RUN curl -Ls https://sh.jbang.dev | bash -s - app setup

ENV PATH="/root/.jbang/bin:${PATH}"

WORKDIR /workspace

9 changes: 9 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
See doc/sphinx-guides/source/developers/testing.rst

To run the metadata block properties verifier in Docker, use:

```bash
tests/verify_mdb_properties_docker.sh
```

This builds a local `dataverse-verify-mdb-properties` image with GraalVM native-image
and JBang, then runs `tests/verify_mdb_properties.sh` inside the container.
22 changes: 22 additions & 0 deletions tests/verify_mdb_properties_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# Run verify_mdb_properties.sh in a Linux container with GraalVM native-image and JBang.

set -euo pipefail

if ! command -v docker > /dev/null 2>&1; then
echo "Cannot find docker on path. Did you install Docker Desktop or another Docker runtime?" >&2
exit 1
fi

REPO_ROOT=$(git rev-parse --show-toplevel)
IMAGE=${VERIFY_MDB_PROPERTIES_IMAGE:-dataverse-verify-mdb-properties}
DOCKERFILE="$REPO_ROOT/tests/Dockerfile.verify_mdb_properties"

docker build -f "$DOCKERFILE" -t "$IMAGE" "$REPO_ROOT"
docker run --rm \
-v "$REPO_ROOT:/workspace" \
-w /workspace \
--entrypoint /bin/bash \
"$IMAGE" \
-lc 'git config --global --add safe.directory /workspace && tests/verify_mdb_properties.sh'
Loading