diff --git a/.travis.yml b/.travis.yml index 0283510d6..48d6749f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,9 +24,9 @@ script: - make image after_success: - if ([ "$TRAVIS_BRANCH" == "master" ] || [ ! -z "$TRAVIS_TAG" ]) && - [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - script/deploy.sh + if ([ "$TRAVIS_BRANCH" = "master" ] || [ ! -z "$TRAVIS_TAG" ]) && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then + echo "Deploying" + make deploy else echo "Skipping deploy" fi diff --git a/Makefile b/Makefile index 790204f44..2d4acdacb 100644 --- a/Makefile +++ b/Makefile @@ -88,3 +88,6 @@ lint: fmt: gofmt -s -l -w $(SRCS) + +deploy: + ./script/deploy.sh diff --git a/script/deploy.sh b/script/deploy.sh old mode 100644 new mode 100755 index a9b22276a..e47c9caa2 --- a/script/deploy.sh +++ b/script/deploy.sh @@ -1,6 +1,13 @@ #!/bin/sh set -e +if ([ "$TRAVIS_BRANCH" = "master" ] || [ ! -z "$TRAVIS_TAG" ]) && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then + echo "Deploying" +else + echo "Skipping deploy" + exit 0 +fi + curl -LO https://github.com/tcnksm/ghr/releases/download/pre-release/linux_amd64.zip unzip -q linux_amd64.zip sudo mv grh /usr/bin/ghr