Skip to content

Commit

Permalink
feat(docker-build): Add <$branch_name-latest> tag
Browse files Browse the repository at this point in the history
  • Loading branch information
gtoselli committed Sep 23, 2021
1 parent 38eb71d commit 11054ff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ gcloud config set project $GCLOUD_PROJECT

VERSION_CODE="$branch_name-$commit_hash"
SERVICE_NAME="$app_name"
REMOTE_IMAGE_PATH="eu.gcr.io/$GCLOUD_PROJECT/$SERVICE_NAME:$VERSION_CODE"
REMOTE_IMAGE_PATH="eu.gcr.io/$GCLOUD_PROJECT/$SERVICE_NAME"
REMOTE_IMAGE_PATH_WITH_TAG="$REMOTE_IMAGE_PATH:$VERSION_CODE"

gcloud auth configure-docker

docker build -t goleedev/$SERVICE_NAME:$VERSION_CODE .
docker tag goleedev/$SERVICE_NAME:$VERSION_CODE $REMOTE_IMAGE_PATH
docker push $REMOTE_IMAGE_PATH
docker tag goleedev/$SERVICE_NAME:$VERSION_CODE $REMOTE_IMAGE_PATH_WITH_TAG
docker tag $REMOTE_IMAGE_PATH_WITH_TAG "${REMOTE_IMAGE_PATH}:latest-${branch_name}"
docker image push --all-tags $REMOTE_IMAGE_PATH

echo "::set-output name=image_path::$REMOTE_IMAGE_PATH"
echo "::set-output name=image_path::$REMOTE_IMAGE_PATH_WITH_TAG"

0 comments on commit 11054ff

Please sign in to comment.