kube-router/build/travis-deploy.sh
Bryan Zubrod db54caf788 CI: Bug fixes, one image per PR (#47)
* One image per PR
* Don't use Travis deploys
* Fix if statement in YAML
2017-07-09 19:28:52 -05:00

23 lines
609 B
Bash
Executable File

#!/usr/bin/env bash
set -o errexit
set -o pipefail
# Pull Request image tag format: PR00-PRUSER
if [ "${TRAVIS_EVENT_TYPE}" = "pull_request" ]; then
PR_USER=$(echo "$TRAVIS_PULL_REQUEST_SLUG" | sed -e 's/\/.*//')
echo "Building/pushing PR$TRAVIS_PULL_REQUEST from $PR_USER"
make push IMG_TAG="PR$TRAVIS_PULL_REQUEST-$PR_USER"
exit 0
fi
# Release image tag format: v0.0.0 and latest
if [ -n "$TRAVIS_TAG" ]; then
echo "Running Release build on Travis"
make release RELEASE_TAG="$TRAVIS_TAG"
exit 0
fi
# Push image tag format: COMMIT
echo "Running push build on Travis"
make push