Commit 3a6e87d Cesar Rodriguez
authored
File tree 2 files changed +5
-8
lines changed
2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ set -o errexit
4
4
set -o nounset
5
5
set -o pipefail
6
6
7
- GIT_COMMIT=$( git rev-parse --short HEAD 2> /dev/null)
8
7
DOCKER_REPO=" accurics/terrascan-action"
8
+ LATEST_TAG=$( git describe --abbrev=0 --tags)
9
+ LATEST_TAG_SHORT=$( echo " ${LATEST_TAG// v} " )
9
10
10
- docker build -t ${DOCKER_REPO} :${GIT_COMMIT} .
11
+ # Builds image with two tags ( :latest & :<TAG_NAME> )
12
+ docker build -t ${DOCKER_REPO} :latest -t ${DOCKER_REPO} :${LATEST_TAG_SHORT} .
Original file line number Diff line number Diff line change @@ -4,11 +4,6 @@ set -o errexit
4
4
set -o nounset
5
5
set -o pipefail
6
6
7
- GIT_COMMIT=$( git rev-parse --short HEAD 2> /dev/null)
8
7
DOCKER_REPO=" accurics/terrascan-action"
9
- LATEST_TAG=$( git describe --abbrev=0 --tags)
10
- LATEST_TAG_SHORT=$( echo " ${LATEST_TAG// v} " )
11
8
12
- # PS: It is a prerequisite to execute 'docker login' before running this script
13
- docker tag ${DOCKER_REPO} :${GIT_COMMIT} ${DOCKER_REPO} :${LATEST_TAG_SHORT}
14
- docker push ${DOCKER_REPO} :${LATEST_TAG_SHORT}
9
+ docker push ${DOCKER_REPO} --all-tags
You can’t perform that action at this time.
0 commit comments