Procházet zdrojové kódy

companion: fixes docker version tagging. fixes #1579.

Matthew Hartstonge před 4 roky
rodič
revize
0367074d92

+ 8 - 4
packages/@uppy/companion/infra/kube/gcloud-deploy.sh

@@ -20,12 +20,16 @@ mv ./kubectl ${HOME}/.local/bin/
 docker build -t transloadit/companion:latest -t transloadit/companion:$TRAVIS_COMMIT -f packages/@uppy/companion/Dockerfile packages/@uppy/companion;
 docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
 
-if [[ -z "${TRAVIS_TAG}" ]]; then
-  docker push transloadit/companion:$TRAVIS_COMMIT;
-else
+# Push the commit tagged docker image.
+docker push transloadit/companion:$TRAVIS_COMMIT;
+
+# If this build includes a git tag, tag the image with the git version tag and push the version.
+if [[ ! -z "${TRAVIS_TAG}" ]]; then
+  docker tag transloadit/companion:$TRAVIS_COMMIT transloadit/companion:$TRAVIS_TAG;
   docker push transloadit/companion:$TRAVIS_TAG;
 fi
 
+# Lastly, update the pointer to latest.
 docker push transloadit/companion:latest;
 
 
@@ -49,4 +53,4 @@ function cleanup {
     printf "Cleaning done."
 }
 
-trap cleanup EXIT
+trap cleanup EXIT