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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ curl -s http://localhost:3000/api/v1/validate/https://dpp.oydapp.eu/01/095201234
```

`./build.sh <ref>` builds with a given commit or tag of dpp-criteria; the
default is `main`. `GET /version` shows the commit in use. The image is built
default is `main`. Branch and tag names are resolved to their commit first, so
that the Docker build cache never reuses an older dpp-criteria. `GET /version` shows the commit in use. The image is built
for linux/amd64, like the SOyA web-cli it contains.

## Deployment
Expand Down
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
# DOCKERHUB=1 ./build.sh build and push
set -eu
REF="${1:-main}"
# A branch or tag is resolved to its commit, so that the Docker build cache
# never reuses a clone of an older dpp-criteria.
RESOLVED=$(git ls-remote https://github.com/OwnYourData/dpp-criteria.git \
"refs/heads/$REF" "refs/tags/$REF" "refs/tags/$REF^{}" | sort -k2 | tail -n1 | cut -f1)
[ -n "$RESOLVED" ] && REF="$RESOLVED"
echo "dpp-criteria: $REF"
docker build --platform linux/amd64 --build-arg DPP_CRITERIA_REF="$REF" -f docker/Dockerfile -t oydeu/dpplint:latest .
if [ "${DOCKERHUB:-0}" = "1" ]; then
docker push oydeu/dpplint:latest
Expand Down
Loading