Skip to content

Commit a217ce8

Browse files
committed
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.
1 parent 794fb45 commit a217ce8

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

.github/workflows/push.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ jobs:
1515
build_cmd:
1616
- ./build-latest.sh
1717
- PRERELEASE=true ./build-latest.sh
18-
- ./build-branches.sh
18+
- ./build-next.sh
19+
- ./build.sh develop
1920
docker_from:
2021
- '' # use the default of the DOCKERFILE
2122
- python:3.7-alpine

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ jobs:
1414
build_cmd:
1515
- ./build-latest.sh
1616
- PRERELEASE=true ./build-latest.sh
17-
- ./build-branches.sh
17+
- ./build-next.sh
18+
- ./build.sh develop
1819
fail-fast: false
1920
runs-on: ubuntu-latest
2021
name: Builds new Netbox Docker Images
2122
steps:
2223
- id: git-checkout
2324
name: Checkout
24-
uses: actions/checkout@v1
25+
uses: actions/checkout@v2
2526
- id: docker-build
2627
name: Build the image with '${{ matrix.build_cmd }}'
2728
run: ${{ matrix.build_cmd }}

build-branches.sh renamed to build-next.sh

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,12 @@ GITHUB_REPO="${GITHUB_REPO-$ORIGINAL_GITHUB_REPO}"
2323
URL_RELEASES="https://api.github.com/repos/${GITHUB_REPO}/branches?${GITHUB_OAUTH_PARAMS}"
2424

2525
# Composing the JQ commans to extract the most recent version number
26-
JQ_BRANCHES='map(.name) | .[] | scan("^[^v].+") | match("^(master|develop).*") | .string'
26+
JQ_NEXT='map(.name) | .[] | scan("^[^v].+") | match("^(develop-).*") | .string'
2727

2828
CURL="curl -sS"
2929

3030
# Querying the Github API to fetch all branches
31-
BRANCHES=$($CURL "${URL_RELEASES}" | jq -r "$JQ_BRANCHES")
31+
NEXT=$($CURL "${URL_RELEASES}" | jq -r "$JQ_NEXT")
3232

33-
###
34-
# Building each branch
35-
###
36-
37-
# keeping track whether an error occured
38-
ERROR=0
39-
40-
# calling build.sh for each branch
41-
for BRANCH in $BRANCHES; do
42-
# shellcheck disable=SC2068
43-
./build.sh "${BRANCH}" $@ || ERROR=1
44-
done
45-
46-
# returning whether an error occured
47-
exit $ERROR
33+
# shellcheck disable=SC2068
34+
./build.sh "${NEXT}" $@

0 commit comments

Comments
 (0)