Skip to content

Commit

Permalink
fix(travis): deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
euskadi31 committed Jan 13, 2019
1 parent 2c03a3a commit cc0f84d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ PROJECT_WORKSPACE="$(cd $PROJECT_WORKSPACE; pwd)"
DOCKER_ORGANISATION="hyperscale"
DOCKER_REPO="hyperpic"

LATEST="false"

echo "Config:"
if [ -z "$TRAVIS_TAG" ]; then
CI_BUILD_VERSION=$(git describe --match 'v[0-9]*' --dirty='-dev' --always)
else
CI_BUILD_VERSION="${TRAVIS_TAG#v}"
DOCKER_TAG="$CI_BUILD_VERSION"
LATEST="true"
fi

if [ -z "$TRAVIS_COMMIT" ]; then
Expand Down Expand Up @@ -55,7 +58,7 @@ docker build --rm \
"$PROJECT_WORKSPACE"

# tagging latest only master branch
if [ "$CI_BUILD_BRANCH" == "master" ]; then
if [ "$LATEST" == "true" ]; then
echo "Tagging $DOCKER_ORGANISATION/$DOCKER_REPO:latest.."
docker tag "$DOCKER_ORGANISATION/$DOCKER_REPO" "$DOCKER_ORGANISATION/$DOCKER_REPO:latest"
fi
Expand All @@ -66,7 +69,7 @@ if [ "$CI" == "true" ]; then
echo "Pushing $DOCKER_ORGANISATION/$DOCKER_REPO:$DOCKER_TAG..."
docker push "$DOCKER_ORGANISATION/$DOCKER_REPO:$DOCKER_TAG"

if [ "$CI_BUILD_BRANCH" == "master" ]; then
if [ "$LATEST" == "true" ]; then
echo "Pushing $DOCKER_ORGANISATION/$DOCKER_REPO:latest..."
docker push "$DOCKER_ORGANISATION/$DOCKER_REPO:latest"
fi
Expand Down

0 comments on commit cc0f84d

Please sign in to comment.