forked from dependency-check/DependencyCheck
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-publish.sh
More file actions
executable file
·15 lines (13 loc) · 814 Bytes
/
docker-publish.sh
File metadata and controls
executable file
·15 lines (13 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash
set -euo pipefail
function mvn_prop() { mvn help:evaluate -q --non-recursive -DforceStdout -Dexpression="$1"; }
read -r VERSION POSTGRES_DRIVER_VERSION MYSQL_DRIVER_VERSION <<< "$(mvn_prop project.version) $(mvn_prop driver.postgresql.version) $(mvn_prop driver.mysql.version)"
if [[ $VERSION = *"SNAPSHOT"* ]]; then
echo "Do not publish a snapshot version of dependency-check"
exit 1
fi
# Build args should match ./docker-build.sh so the builder cache is re-used
docker buildx build --pull=false --push --platform linux/amd64,linux/arm64 . \
--build-arg "VERSION=$VERSION" --build-arg "POSTGRES_DRIVER_VERSION=$POSTGRES_DRIVER_VERSION" --build-arg "MYSQL_DRIVER_VERSION=$MYSQL_DRIVER_VERSION" \
--tag owasp/dependency-check:$VERSION \
--tag owasp/dependency-check:latest