Skip to content

Commit 8946936

Browse files
Try to support semver for Docker Hub image tag by adjusting build hook
1 parent be8bdcf commit 8946936

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hooks/build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/sh
22

33
if [ "latest" = "$DOCKER_TAG" ]; then
4-
DOCKER_TAG=$(curl https://registry.npmjs.org/jsonlint -sLo- | grep -Po '"latest":"\d+\.\d+\.\d+"' | awk -F'"' '{print $4}')
4+
JSONLINT_VERSION=$(curl https://registry.npmjs.org/jsonlint -sLo- | grep -Po '"latest":"\d+\.\d+\.\d+"' | awk -F'"' '{print $4}')
5+
else
6+
JSONLINT_VERSION="$SOURCE_BRANCH"
57
fi
68

7-
docker build --build-arg JSONLINT_VERSION="$DOCKER_TAG" -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" .
9+
docker build --build-arg JSONLINT_VERSION="$JSONLINT_VERSION" -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" .

0 commit comments

Comments
 (0)