Skip to content

Commit a4186c1

Browse files
committed
Prepares scripts and documentation for #184
1 parent c083baf commit a4186c1

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

DOCKER_HUB.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ Autotest: Internal and External Pull Requests
1111
Repository Links: Enable for Base Image
1212
Build Rules:
1313
- Source Type: Branch
14-
Source: master
14+
Source: release
1515
Docker Tag: branches
1616
Dockerfile location: Dockerfile
1717
Build Context: /
1818
Autobuild: on
1919
Build Caching: on
2020
- Source Type: Branch
21-
Source: master
21+
Source: release
2222
Docker Tag: prerelease
2323
Dockerfile location: Dockerfile
2424
Build Context: /
2525
Autobuild: on
2626
Build Caching: on
2727
- Source Type: Branch
28-
Source: master
28+
Source: release
2929
Docker Tag: release
3030
Dockerfile location: Dockerfile
3131
Build Context: /

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ Then there is currently one extra tags for each of the above labels:
4343

4444
## Quickstart
4545

46-
To get Netbox up and running:
46+
To get Netbox up and running in Docker:
4747

4848
```bash
49-
git clone -b master https://github.com/netbox-community/netbox-docker.git
49+
git clone -b release https://github.com/netbox-community/netbox-docker.git
5050
cd netbox-docker
5151
docker-compose pull
5252
docker-compose up -d

build-branches.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Builds develop, develop-* and master branches
2+
# Builds develop, develop-* and master branches of Netbox
33

44
echo "▶️ $0 $*"
55

build.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ if [ "${1}x" == "x" ] || [ "${1}" == "--help" ] || [ "${1}" == "-h" ]; then
2727
echo " Default: undefined"
2828
echo " TAG The version part of the docker tag."
2929
echo " Default:"
30-
echo " When \${BRANCH}=master: latest"
31-
echo " When \${BRANCH}=develop: snapshot"
32-
echo " Else: same as \${BRANCH}"
30+
echo " When <branch>=master: latest"
31+
echo " When <branch>=develop: snapshot"
32+
echo " Else: same as <branch>"
3333
echo " DOCKER_REGISTRY The Docker repository's registry (i.e. '\${DOCKER_REGISTRY}/\${DOCKER_ORG}/\${DOCKER_REPO}'')"
3434
echo " Used for tagging the image."
3535
echo " Default: docker.io"
@@ -106,17 +106,17 @@ fi
106106
###
107107
SRC_ORG="${SRC_ORG-netbox-community}"
108108
SRC_REPO="${SRC_REPO-netbox}"
109-
BRANCH="${1}"
109+
NETBOX_BRANCH="${1}"
110110
URL="${URL-https://github.com/${SRC_ORG}/${SRC_REPO}.git}"
111111
NETBOX_PATH="${NETBOX_PATH-.netbox}"
112112

113113
###
114114
# fetching the source
115115
###
116116
if [ "${2}" != "--push-only" ] && [ -z "${SKIP_GIT}" ] ; then
117-
echo "🌐 Checking out '${BRANCH}' of netbox from the url '${URL}' into '${NETBOX_PATH}'"
117+
echo "🌐 Checking out '${NETBOX_BRANCH}' of netbox from the url '${URL}' into '${NETBOX_PATH}'"
118118
if [ ! -d "${NETBOX_PATH}" ]; then
119-
$DRY git clone -q --depth 10 -b "${BRANCH}" "${URL}" "${NETBOX_PATH}"
119+
$DRY git clone -q --depth 10 -b "${NETBOX_BRANCH}" "${URL}" "${NETBOX_PATH}"
120120
fi
121121

122122
(
@@ -127,7 +127,7 @@ if [ "${2}" != "--push-only" ] && [ -z "${SKIP_GIT}" ] ; then
127127
fi
128128

129129
$DRY git remote set-url origin "${URL}"
130-
$DRY git fetch -qp --depth 10 origin "${BRANCH}"
130+
$DRY git fetch -qp --depth 10 origin "${NETBOX_BRANCH}"
131131
$DRY git checkout -qf FETCH_HEAD
132132
$DRY git prune
133133
)
@@ -174,13 +174,13 @@ fi
174174
DOCKER_REGISTRY="${DOCKER_REGISTRY-docker.io}"
175175
DOCKER_ORG="${DOCKER_ORG-netboxcommunity}"
176176
DOCKER_REPO="${DOCKER_REPO-netbox}"
177-
case "${BRANCH}" in
177+
case "${NETBOX_BRANCH}" in
178178
master)
179179
TAG="${TAG-latest}";;
180180
develop)
181181
TAG="${TAG-snapshot}";;
182182
*)
183-
TAG="${TAG-$BRANCH}";;
183+
TAG="${TAG-$NETBOX_BRANCH}";;
184184
esac
185185

186186
###
@@ -241,7 +241,7 @@ for DOCKER_TARGET in "${DOCKER_TARGETS[@]}"; do
241241
if [ "${DOCKER_TARGET}" == "main" ]; then
242242
DOCKER_BUILD_ARGS+=(
243243
--label "ORIGINAL_TAG=${TARGET_DOCKER_TAG}"
244-
244+
245245
--label "org.label-schema.build-date=${BUILD_DATE}"
246246
--label "org.opencontainers.image.created=${BUILD_DATE}"
247247

hooks/common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ run_build() {
3131
./build-branches.sh $@
3232
;;
3333
this) # Pull Requests
34-
# only build the 'master' branch
34+
# only build the 'master' branch of netbox
3535
# (resulting in the 'latest' docker tag)
3636
# and the 'main' target.
3737
DOCKER_TARGET=main ./build.sh master

hooks/push

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
. hooks/common
44

5-
if [ "${SOURCE_BRANCH}" == "master" ] || [ "${DEBUG}" == "true" ]; then
6-
if [ "${SOURCE_BRANCH}" != "master" ]; then
5+
if [ "${SOURCE_BRANCH}" == "release" ] || [ "${DEBUG}" == "true" ]; then
6+
if [ "${SOURCE_BRANCH}" != "release" ]; then
77
echo "⚠️⚠️⚠️ Would exit, but DEBUG is '${DEBUG}'".
88
fi
99

0 commit comments

Comments
 (0)