Skip to content
This repository was archived by the owner on May 2, 2021. It is now read-only.

Commit 03e442a

Browse files
committed
Fixes
1 parent 568ec2b commit 03e442a

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

entrypoint.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,35 @@ function main() {
2929
CONTEXT="${INPUT_CONTEXT}"
3030
fi
3131

32+
if [ -z "${INPUT_SEMVER}" ]; then
33+
INPUT_SEMVER="latest"
34+
fi;
35+
3236
DOCKER_LATEST="${INPUT_NAME}:latest"
3337

3438
echo "::debug file=entrypoint.sh::Starting docker build $BUILDPARAMS -t ${DOCKER_LATEST} ${CONTEXT}"
3539
docker build $BUILDPARAMS -t ${DOCKER_LATEST} ${CONTEXT}
3640
echo "::debug file=entrypoint.sh::Finished building ${DOCKER_LATEST}"
37-
41+
3842
echo "::debug file=entrypoint.sh::Starting docker push ${DOCKER_LATEST}"
3943
docker push ${DOCKER_LATEST}
4044
echo "::debug file=entrypoint.sh::Finished pushing ${DOCKER_LATEST}"
41-
45+
4246
IMAGE_ID="$(docker images -q ${DOCKER_LATEST})"
4347
echo "::debug file=entrypoint.sh::Image Id: ${IMAGE_ID}"
44-
48+
4549
CONTAINER_ID="$(docker create ${IMAGE_ID})"
4650
echo "::debug file=entrypoint.sh::Container Id: ${CONTAINER_ID}"
47-
51+
4852
docker cp $CONTAINER_ID:VERSION ./version
4953
docker rm $CONTAINER_ID
50-
54+
5155
VERSION="$(cat version)"
5256
echo "::debug file=entrypoint.sh::Version: $VERSION"
53-
57+
5458
if [ -z "${VERSION}" ]; then
55-
INPUT_SEMVER=$VERSION
56-
fi;
57-
58-
if [ -z "${INPUT_SEMVER}" ]; then
59-
INPUT_SEMVER="latest"
59+
INPUT_SEMVER="${VERSION}"
60+
echo "::debug: file=entrypoint.sh::Version overridden with: ${VERSION}"
6061
fi;
6162

6263
if [ "${INPUT_SEMVER}" = "latest" ]; then

0 commit comments

Comments
 (0)