Changed "build-branches.sh" to "build-next.sh"
The old version of "build-branches.sh" skipped the pushing of images when one of them didn't change its sources. When looking at the Netbox branches I noticed that the "master" branch only changes when there is a new release. Because we build the new releases anyway in "build-latest.sh" that leaves "develop" and "develop-*" which change regularly. The new script "build-next.sh" is responsible for building "develop-*" as the next major release of Netbox. The build of "develop" is moved to the Github Action build matrix. This has the additional advantage of being faster because more builds are done in parallel.
This commit is contained in:
parent
794fb45e0e
commit
a217ce8ffd
3
.github/workflows/push.yml
vendored
3
.github/workflows/push.yml
vendored
@ -15,7 +15,8 @@ jobs:
|
|||||||
build_cmd:
|
build_cmd:
|
||||||
- ./build-latest.sh
|
- ./build-latest.sh
|
||||||
- PRERELEASE=true ./build-latest.sh
|
- PRERELEASE=true ./build-latest.sh
|
||||||
- ./build-branches.sh
|
- ./build-next.sh
|
||||||
|
- ./build.sh develop
|
||||||
docker_from:
|
docker_from:
|
||||||
- '' # use the default of the DOCKERFILE
|
- '' # use the default of the DOCKERFILE
|
||||||
- python:3.7-alpine
|
- python:3.7-alpine
|
||||||
|
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@ -14,14 +14,15 @@ jobs:
|
|||||||
build_cmd:
|
build_cmd:
|
||||||
- ./build-latest.sh
|
- ./build-latest.sh
|
||||||
- PRERELEASE=true ./build-latest.sh
|
- PRERELEASE=true ./build-latest.sh
|
||||||
- ./build-branches.sh
|
- ./build-next.sh
|
||||||
|
- ./build.sh develop
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Builds new Netbox Docker Images
|
name: Builds new Netbox Docker Images
|
||||||
steps:
|
steps:
|
||||||
- id: git-checkout
|
- id: git-checkout
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v2
|
||||||
- id: docker-build
|
- id: docker-build
|
||||||
name: Build the image with '${{ matrix.build_cmd }}'
|
name: Build the image with '${{ matrix.build_cmd }}'
|
||||||
run: ${{ matrix.build_cmd }}
|
run: ${{ matrix.build_cmd }}
|
||||||
|
@ -23,25 +23,12 @@ GITHUB_REPO="${GITHUB_REPO-$ORIGINAL_GITHUB_REPO}"
|
|||||||
URL_RELEASES="https://api.github.com/repos/${GITHUB_REPO}/branches?${GITHUB_OAUTH_PARAMS}"
|
URL_RELEASES="https://api.github.com/repos/${GITHUB_REPO}/branches?${GITHUB_OAUTH_PARAMS}"
|
||||||
|
|
||||||
# Composing the JQ commans to extract the most recent version number
|
# Composing the JQ commans to extract the most recent version number
|
||||||
JQ_BRANCHES='map(.name) | .[] | scan("^[^v].+") | match("^(master|develop).*") | .string'
|
JQ_NEXT='map(.name) | .[] | scan("^[^v].+") | match("^(develop-).*") | .string'
|
||||||
|
|
||||||
CURL="curl -sS"
|
CURL="curl -sS"
|
||||||
|
|
||||||
# Querying the Github API to fetch all branches
|
# Querying the Github API to fetch all branches
|
||||||
BRANCHES=$($CURL "${URL_RELEASES}" | jq -r "$JQ_BRANCHES")
|
NEXT=$($CURL "${URL_RELEASES}" | jq -r "$JQ_NEXT")
|
||||||
|
|
||||||
###
|
|
||||||
# Building each branch
|
|
||||||
###
|
|
||||||
|
|
||||||
# keeping track whether an error occured
|
|
||||||
ERROR=0
|
|
||||||
|
|
||||||
# calling build.sh for each branch
|
|
||||||
for BRANCH in $BRANCHES; do
|
|
||||||
# shellcheck disable=SC2068
|
# shellcheck disable=SC2068
|
||||||
./build.sh "${BRANCH}" $@ || ERROR=1
|
./build.sh "${NEXT}" $@
|
||||||
done
|
|
||||||
|
|
||||||
# returning whether an error occured
|
|
||||||
exit $ERROR
|
|
Loading…
Reference in New Issue
Block a user