File tree Expand file tree Collapse file tree 5 files changed +39
-10
lines changed Expand file tree Collapse file tree 5 files changed +39
-10
lines changed Original file line number Diff line number Diff line change @@ -15,17 +15,21 @@ jobs:
15
15
- ' ' # use the default of the DOCKERFILE
16
16
- python:3.7-alpine
17
17
- python:3.8-alpine
18
- # - python:3.9-rc-alpine # Netbox does not work with Python 3.9 yet.
18
+ - python:3.9-rc-alpine
19
19
fail-fast : false
20
20
runs-on : ubuntu-latest
21
21
name : Builds new Netbox Docker Images
22
22
steps :
23
- - name : Checkout
23
+ - id : git-checkout
24
+ name : Checkout
24
25
uses : actions/checkout@v1
25
- - name : Build the image from '${{ matrix.docker_from }}' with '${{ matrix.build_cmd }}'
26
+ - id : docker-build
27
+ name : Build the image from '${{ matrix.docker_from }}' with '${{ matrix.build_cmd }}'
26
28
run : ${{ matrix.build_cmd }}
27
29
env :
28
30
DOCKER_FROM : ${{ matrix.docker_from }}
29
31
GH_ACTION : enable
30
- - name : Test the image
32
+ - id : docker-test
33
+ name : Test the image
31
34
run : IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
35
+ if : steps.docker-build.outputs.skipped != 'true'
Original file line number Diff line number Diff line change @@ -17,23 +17,33 @@ jobs:
17
17
runs-on : ubuntu-latest
18
18
name : Builds new Netbox Docker Images
19
19
steps :
20
- - name : Checkout
20
+ - id : git-checkout
21
+ name : Checkout
21
22
uses : actions/checkout@v1
22
- - name : Build the image with '${{ matrix.build_cmd }}'
23
+ - id : docker-build
24
+ name : Build the image with '${{ matrix.build_cmd }}'
23
25
run : ${{ matrix.build_cmd }}
24
26
env :
25
27
GH_ACTION : enable
26
- - name : Test the image
28
+ - id : docker-test
29
+ name : Test the image
27
30
run : IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
28
- - name : Login to the Docker Registry
31
+ if : steps.docker-build.outputs.skipped != 'true'
32
+ - id : registry-login
33
+ name : Login to the Docker Registry
29
34
run : |
30
35
echo "::add-mask::$DOCKERHUB_USERNAME"
31
36
echo "::add-mask::$DOCKERHUB_PASSWORD"
32
37
docker login -u "$DOCKERHUB_USERNAME" --password "${DOCKERHUB_PASSWORD}" "${DOCKER_REGISTRY}"
33
38
env :
34
39
DOCKERHUB_USERNAME : ${{ secrets.dockerhub_username }}
35
40
DOCKERHUB_PASSWORD : ${{ secrets.dockerhub_password }}
36
- - name : Push the image
41
+ if : steps.docker-build.outputs.skipped != 'true'
42
+ - id : registry-push
43
+ name : Push the image
37
44
run : ${{ matrix.build_cmd }} --push-only
38
- - name : Logout of the Docker Registry
45
+ if : steps.docker-build.outputs.skipped != 'true'
46
+ - id : registry-logout
47
+ name : Logout of the Docker Registry
39
48
run : docker logout "${DOCKER_REGISTRY}"
49
+ if : steps.docker-build.outputs.skipped != 'true'
Original file line number Diff line number Diff line change @@ -66,6 +66,10 @@ if [ "${PRERELEASE}" == "true" ]; then
66
66
67
67
echo " ❎ Latest unstable version '${VERSION} ' is not higher than the latest stable version '$STABLE_VERSION '."
68
68
if [ -z " $DEBUG " ]; then
69
+ if [ -n " ${GH_ACTION} " ]; then
70
+ echo " ::set-output name=skipped::true"
71
+ fi
72
+
69
73
exit 0
70
74
else
71
75
echo " ⚠️ Would exit here with code '0', but DEBUG is enabled."
Original file line number Diff line number Diff line change @@ -210,6 +210,7 @@ for DOCKER_TARGET in "${DOCKER_TARGETS[@]}"; do
210
210
fi
211
211
if [ -n " ${GH_ACTION} " ]; then
212
212
echo " ::set-env name=FINAL_DOCKER_TAG::${TARGET_DOCKER_TAG} "
213
+ echo " ::set-output name=skipped::false"
213
214
fi
214
215
215
216
# ##
Original file line number Diff line number Diff line change 7
7
# of the Docker Image that is to be used
8
8
export IMAGE=" ${IMAGE-netboxcommunity/ netbox: latest} "
9
9
10
+ if [ -z " ${IMAGE} " ]; then
11
+ echo " ⚠️ No image defined"
12
+
13
+ if [ -z " ${DEBUG} " ]; then
14
+ exit 1;
15
+ else
16
+ echo " ⚠️ Would 'exit 1' here, but DEBUG is '${DEBUG} '."
17
+ fi
18
+ fi
19
+
10
20
# The docker compose command to use
11
21
doco=" docker-compose -f docker-compose.test.yml"
12
22
You can’t perform that action at this time.
0 commit comments