Skip to content

Commit

Permalink
final travis config for release
Browse files Browse the repository at this point in the history
  • Loading branch information
strider2038 committed Feb 18, 2019
1 parent 3f2d76a commit 2db032b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 5 additions & 3 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ image_name="swaggermock/swagger-mock"

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

echo "Builder docker image $image_name..."
echo "Builder docker image ${image_name}..."

docker build --pull --tag "$image_name" .
docker build --pull --tag "${image_name}" .
if [ "${?}" != "0" ]; then
exit 1;
fi

docker tag "${image_name}" "${image_name}:latest"
docker tag "${image_name}" "${image_name}:${version}"

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

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

echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
echo "Deploying image $image_name to DockerHub..."
echo "Deploying image ${image_name} to DockerHub..."

docker push "$image_name"
docker push "${image_name}"
if [ "${?}" != "0" ]; then
exit 1;
fi

docker push "${image_name}:$version"
if [ "${?}" != "0" ]; then
exit 1;
fi

0 comments on commit 2db032b

Please sign in to comment.