From 38fc402b16b25378e9f5fedea985a6b05f44d5a8 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 20 Mar 2020 07:12:07 +0100 Subject: [PATCH] Improved docker build script to avoid duplicating code --- scripts/docker/build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/docker/build b/scripts/docker/build index 8331532e..48b49934 100755 --- a/scripts/docker/build +++ b/scripts/docker/build @@ -3,12 +3,12 @@ set -e echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin -# If a tag exists, build both that tag and stable -if [[ ! -z $TRAVIS_TAG ]]; then - docker build --build-arg VERSION=${TRAVIS_TAG#?} -t shlinkio/shlink-web-client:${TRAVIS_TAG#?} -t shlinkio/shlink-web-client:stable . +if [[ -z $TRAVIS_TAG ]]; then + docker build -t shlinkio/shlink-web-client:latest . +else + docker build --build-arg VERSION=${TRAVIS_TAG#?} -t shlinkio/shlink-web-client:${TRAVIS_TAG#?} -t shlinkio/shlink-web-client:stable -t shlinkio/shlink-web-client:latest . docker push shlinkio/shlink-web-client:${TRAVIS_TAG#?} docker push shlinkio/shlink-web-client:stable fi -docker build -t shlinkio/shlink-web-client:latest . docker push shlinkio/shlink-web-client:latest