From b35ad76ec6e114829ab54958d1f9dc94f21b4430 Mon Sep 17 00:00:00 2001 From: emile Date: Mon, 22 Feb 2016 15:01:00 +0100 Subject: [PATCH] rewrite deploy tests --- .travis.yml | 6 +++--- Makefile | 3 +++ script/deploy.sh | 7 +++++++ 3 files changed, 13 insertions(+), 3 deletions(-) mode change 100644 => 100755 script/deploy.sh 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