-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker image release tagging on release
Add tagging of the Docker image with the release number when creating a Git tag. Resolves #398
- Loading branch information
1 parent
9b32df3
commit a086a65
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null) | ||
DOCKER_REPO="accurics/terrascan" | ||
DOCKERFILE="./build/Dockerfile" | ||
LATEST_TAG=$(git describe --abbrev=0 --tags) | ||
LATEST_TAG_SHORT=$(echo "${LATEST_TAG//v}") | ||
|
||
# PS: It is a prerequisite to execute 'docker login' before running this script | ||
docker tag ${DOCKER_REPO}:${GIT_COMMIT} ${DOCKER_REPO}:${LATEST_TAG_SHORT} | ||
docker push ${DOCKER_REPO}:${LATEST_TAG_SHORT} |