Skip to content

Commit

Permalink
travis config for tag release
Browse files Browse the repository at this point in the history
  • Loading branch information
strider2038 committed Feb 18, 2019
1 parent 88853a2 commit 3f2d76a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ install:

script:
- ./vendor/bin/phpunit
- ./vendor/bin/behat --format=progress
- bash ./build/build.sh

deploy:
Expand Down
7 changes: 5 additions & 2 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
image_name="swaggermock/swagger-mock"

if [ "$TRAVIS_TAG" != "" ]; then
image_name="$image_name:$TRAVIS_TAG"
version="${TRAVIS_TAG:1}"
image_name="$image_name:$version"
fi

docker build --pull --tag "swaggermock/swagger-mock" .
echo "Builder docker image $image_name..."

docker build --pull --tag "$image_name" .
if [ "${?}" != "0" ]; then
exit 1;
fi
Expand Down
3 changes: 2 additions & 1 deletion build/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
image_name="swaggermock/swagger-mock"

if [ "$TRAVIS_TAG" != "" ]; then
image_name="$image_name:$TRAVIS_TAG"
version="${TRAVIS_TAG:1}"
image_name="$image_name:$version"
fi

echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
Expand Down

0 comments on commit 3f2d76a

Please sign in to comment.