From 2e819bf094c74e79e7d8696aa3361dd7a921ca8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ma=CC=88der?= Date: Tue, 30 Jan 2018 11:45:53 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9D=87=EF=B8=8F=20Automatically=20build=20al?= =?UTF-8?q?l=20branches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .. which are not version branches. --- .travis.yml | 4 +--- build-branches.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100755 build-branches.sh diff --git a/.travis.yml b/.travis.yml index 43e64aa..41381e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,9 +20,7 @@ after_script: after_success: - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" - if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then - ./build.sh master --push; - ./build.sh develop --push; - ./build.sh develop-2.3 --push; + ./build-branches.sh --push; ./build-latest.sh --push; PRERELEASE=true ./build-latest.sh --push; fi diff --git a/build-branches.sh b/build-branches.sh new file mode 100755 index 0000000..0b32ae9 --- /dev/null +++ b/build-branches.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +ORIGINAL_GITHUB_REPO="digitalocean/netbox" +GITHUB_REPO="${GITHUB_REPO-$ORIGINAL_GITHUB_REPO}" +URL_RELEASES="https://api.github.com/repos/${GITHUB_REPO}/branches" + +CURL_OPTS="-s" +CURL="curl ${CURL_OPTS}" + +BRANCHES=$($CURL "${URL_RELEASES}" | jq -r 'map(.name) | .[] | scan("^[^v].+")') + +for BRANCH in $BRANCHES; do + ./build.sh "${BRANCH}" $@ +done