2018-01-30 04:45:53 -06:00
|
|
|
#!/bin/bash
|
2018-04-10 03:13:53 -05:00
|
|
|
# Builds develop, develop-* and master branches
|
2018-01-30 04:45:53 -06:00
|
|
|
|
2018-04-10 03:58:31 -05:00
|
|
|
echo "▶️ $0 $*"
|
2018-04-10 04:13:52 -05:00
|
|
|
set -x
|
2018-04-10 03:58:31 -05:00
|
|
|
|
2018-01-30 04:45:53 -06:00
|
|
|
ORIGINAL_GITHUB_REPO="digitalocean/netbox"
|
|
|
|
GITHUB_REPO="${GITHUB_REPO-$ORIGINAL_GITHUB_REPO}"
|
|
|
|
URL_RELEASES="https://api.github.com/repos/${GITHUB_REPO}/branches"
|
|
|
|
|
2018-03-05 07:29:24 -06:00
|
|
|
CURL="curl -sS"
|
2018-01-30 04:45:53 -06:00
|
|
|
|
2018-04-10 03:13:53 -05:00
|
|
|
BRANCHES=$($CURL "${URL_RELEASES}" | jq -r 'map(.name) | .[] | scan("^[^v].+") | match("^(master|develop).*") | .string')
|
2018-01-30 04:45:53 -06:00
|
|
|
|
2018-04-06 04:15:39 -05:00
|
|
|
ERROR=0
|
|
|
|
|
2018-01-30 04:45:53 -06:00
|
|
|
for BRANCH in $BRANCHES; do
|
2018-03-05 07:29:24 -06:00
|
|
|
# shellcheck disable=SC2068
|
2018-04-06 04:15:39 -05:00
|
|
|
./build.sh "${BRANCH}" $@ || ERROR=1
|
2018-01-30 04:45:53 -06:00
|
|
|
done
|
2018-04-06 04:15:39 -05:00
|
|
|
exit $ERROR
|