2020-03-21 02:42:13 -05:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
|
|
|
|
|
|
|
# If there is a tag, regardless the branch, build that docker tag and also "stable"
|
|
|
|
if [[ ! -z $TRAVIS_TAG ]]; then
|
2020-03-21 09:43:52 -05:00
|
|
|
docker build --build-arg SHLINK_VERSION=${TRAVIS_TAG#?} -t shlinkio/shlink:${TRAVIS_TAG#?} -t shlinkio/shlink:stable .
|
2020-03-21 02:42:13 -05:00
|
|
|
docker push shlinkio/shlink:${TRAVIS_TAG#?}
|
|
|
|
docker push shlinkio/shlink:stable
|
|
|
|
# If build branch is develop, build latest (on master, when there's no tag, do not build anything)
|
|
|
|
elif [[ "$TRAVIS_BRANCH" == 'develop' ]]; then
|
|
|
|
docker build -t shlinkio/shlink:latest .
|
|
|
|
docker push shlinkio/shlink:latest
|
|
|
|
fi
|