diff --git a/.travis.yml b/.travis.yml index f9934730..b9761a8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ services: env: global: - - VERSION=0.242 + - VERSION=0.243 - DB_HOST=localhost - DB_USER=travis - DB_PASS= @@ -69,4 +69,7 @@ script: - go test -v after_success: - - if [[ "$TRAVIS_BRANCH" == "master" ]]; then /bin/bash -c ./build.sh; fi \ No newline at end of file + - if [[ "$TRAVIS_BRANCH" == "master" ]]; then /bin/bash -c .travis/build.sh; fi + +after_deploy: + - /bin/bash -c .travis/deploy.sh \ No newline at end of file diff --git a/build.sh b/.travis/build.sh similarity index 76% rename from build.sh rename to .travis/build.sh index db4ce298..b3ccfa82 100755 --- a/build.sh +++ b/.travis/build.sh @@ -43,24 +43,4 @@ mv $APP-linux-arm-7 $APP tar -czvf $APP-linux-arm7.tar.gz $APP && rm -f $APP mv $APP-linux-arm64 $APP -tar -czvf $APP-linux-arm64.tar.gz $APP && rm -f $APP - -body='{ - "request": { - "branch":"master", - "config": { - "merge_mode": "merge", - "env": { - "VERSION": "'"$VERSION"'" - } - } - } -}' - -curl -s -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Travis-API-Version: 3" \ - -H "Authorization: token $TRAVIS_API" \ - -d "$body" \ - https://api.travis-ci.com/repo/hunterlong%2Fhomebrew-statup/requests \ No newline at end of file +tar -czvf $APP-linux-arm64.tar.gz $APP && rm -f $APP \ No newline at end of file diff --git a/.travis/deploy.sh b/.travis/deploy.sh new file mode 100755 index 00000000..95a93a03 --- /dev/null +++ b/.travis/deploy.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# update homebrew to newest version by building on travis +body='{ + "request": { + "branch":"master", + "config": { + "merge_mode": "merge", + "env": { + "VERSION": "'"$VERSION"'" + } + } + } +}' +curl -s -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Travis-API-Version: 3" \ + -H "Authorization: token $TRAVIS_API" \ + -d "$body" \ + https://api.travis-ci.com/repo/hunterlong%2Fhomebrew-statup/requests + + +if [ "$TRAVIS_BRANCH" == "master" ] +then + curl -X POST $DOCKER > /dev/null +else + curl -H "Content-Type: application/json" --data '{"source_type": "Tag", "source_name": "v'"$VERSION"'"}' -X POST $DOCKER > /dev/null +fi \ No newline at end of file