Skip to content

Commit

Permalink
fix(plugins/docker): fix regression added in two releases
Browse files Browse the repository at this point in the history
  • Loading branch information
dalisoft committed Jun 24, 2024
1 parent 8ac93a1 commit 8429d6e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions plugins/docker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/sh
set -eu

prepare() {

printf "%s" "${DOCKER_HUB_PAT-}" | docker login --username "${DOCKER_HUB_USERNAME-}" --password-stdin
}

cleanup() {
docker logout
}

release() {
# Build and publish a `Docker` tag
if [ -n "${DOCKER_HUB_USERNAME-}" ] && [ -n "${DOCKER_HUB_PAT-}" ]; then
Expand All @@ -17,11 +26,15 @@ release() {
return 1
fi

prepare

docker build -t "${GIT_REPO_NAME-}:${NEXT_BUILD_VERSION-}" . --push
docker tag "${GIT_REPO_NAME}:${NEXT_BUILD_VERSION}" "${GIT_REPO_NAME}:latest"
docker push "${GIT_REPO_NAME}:latest"

log "Docker image published [${NEXT_RELEASE_TAG}]!"

cleanup
else
log "Skipped Docker image [${NEXT_RELEASE_TAG}] in DRY-RUN mode."
fi
Expand Down

0 comments on commit 8429d6e

Please sign in to comment.