Skip to content

Commit d058b7b

Browse files
authored
Merge pull request #226 from netbox-community/develop
Release 0.21.0
2 parents 79a10dd + a0f5a11 commit d058b7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+589
-262
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
env
66
build*
77
docker-compose.override.yml
8+
.netbox/.git*
9+
.netbox/.travis.yml
10+
.netbox/docs
11+
.netbox/scripts

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Please try this means to get help before opening an issue here:
2525
* On the networktocode Slack in the #netbox channel: http://slack.networktocode.com/
2626
* On the Netbox mailing list: https://groups.google.com/d/forum/netbox-discuss
2727
28+
Please don't open an issue when you have a PR ready. Just submit the PR, that's good enough.
29+
2830
-->
2931

3032
## Current Behavior

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Please try this means to get help before opening an issue here:
2424
* On the networktocode Slack in the #netbox channel: http://slack.networktocode.com/
2525
* On the Netbox mailing list: https://groups.google.com/d/forum/netbox-discuss
2626
27+
Please don't open an issue when you have a PR ready. Just submit the PR, that's good enough.
28+
2729
-->
2830

2931
## Desired Behavior
@@ -33,7 +35,7 @@ Please try this means to get help before opening an issue here:
3335

3436
## Contrast to Current Behavior
3537

36-
<!-- please describe how the desired behavior is different to the current behavior -->
38+
<!-- please describe how the desired behavior is different from the current behavior -->
3739
...
3840

3941
## Changes Required

.github/pull_request_template.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<!--
2+
###############################################################################
3+
4+
Thank you for sharing your work and for opening a PR.
5+
6+
(!) IMPORTANT (!):
7+
First make sure that you point your PR to the `develop` branch!
8+
9+
Now please read the comments carefully and try to provide information
10+
on all relevant titles.
11+
12+
###############################################################################
13+
-->
14+
15+
<!--
16+
Please don't open an extra issue when submiting a PR.
17+
18+
But if there is already a related issue, please put it's number here.
19+
20+
E.g. #123 or N/A
21+
-->
22+
23+
Related Issue:
24+
25+
## New Behavior
26+
27+
<!--
28+
Please describe in a few words the intentions of your PR.
29+
-->
30+
31+
...
32+
33+
## Contrast to Current Behavior
34+
35+
<!--
36+
Please describe in a few words how the new behavior is different
37+
from the current behavior.
38+
-->
39+
40+
...
41+
42+
## Discussion: Benefits and Drawbacks
43+
44+
<!--
45+
Please make your case here:
46+
47+
- Why do you think this project and the community will benefit from your
48+
proposed change?
49+
- What are the drawbacks of this change?
50+
- Is it backwards-compatible?
51+
- Anything else that you think is relevant to the discussion of this PR.
52+
53+
(No need to write a huge article here. Just a few sentences that give some
54+
additional context about the motivations for the change.)
55+
-->
56+
57+
...
58+
59+
## Changes to the Wiki
60+
61+
<!--
62+
If the README.md must be updated, please include the changes in the PR.
63+
If the Wiki must be updated, please make a suggestion below.
64+
-->
65+
66+
...
67+
68+
## Proposed Release Note Entry
69+
70+
<!--
71+
Please provide a short summary of your PR that we can copy & paste
72+
into the release notes.
73+
-->
74+
75+
...
76+
77+
## Double Check
78+
79+
<!--
80+
Please put an x into the brackets (like `[x]`) if you've completed that task.
81+
-->
82+
83+
* [ ] I have read the comments and followed the PR template.
84+
* [ ] I have provided and explained my PR according to the information in the comments.
85+
* [ ] My PR targets the `develop` branch.

.github/workflows/push.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
on:
2+
push:
3+
branches-ignore:
4+
- release
5+
6+
jobs:
7+
build:
8+
strategy:
9+
matrix:
10+
build_cmd:
11+
- ./build-latest.sh
12+
- PRERELEASE=true ./build-latest.sh
13+
- ./build-branches.sh
14+
docker_from:
15+
- '' # use the default of the DOCKERFILE
16+
- python:3.7-alpine
17+
- python:3.8-alpine
18+
- python:3.9-rc-alpine
19+
fail-fast: false
20+
runs-on: ubuntu-latest
21+
name: Builds new Netbox Docker Images
22+
steps:
23+
- id: git-checkout
24+
name: Checkout
25+
uses: actions/checkout@v1
26+
- id: docker-build
27+
name: Build the image from '${{ matrix.docker_from }}' with '${{ matrix.build_cmd }}'
28+
run: ${{ matrix.build_cmd }}
29+
env:
30+
DOCKER_FROM: ${{ matrix.docker_from }}
31+
GH_ACTION: enable
32+
- id: docker-test
33+
name: Test the image
34+
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
35+
if: steps.docker-build.outputs.skipped != 'true'

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
push:
3+
branches:
4+
- release
5+
schedule:
6+
- cron: '45 5 * * *'
7+
8+
jobs:
9+
build:
10+
strategy:
11+
matrix:
12+
build_cmd:
13+
- ./build-latest.sh
14+
- PRERELEASE=true ./build-latest.sh
15+
- ./build-branches.sh
16+
fail-fast: false
17+
runs-on: ubuntu-latest
18+
name: Builds new Netbox Docker Images
19+
steps:
20+
- id: git-checkout
21+
name: Checkout
22+
uses: actions/checkout@v1
23+
- id: docker-build
24+
name: Build the image with '${{ matrix.build_cmd }}'
25+
run: ${{ matrix.build_cmd }}
26+
env:
27+
GH_ACTION: enable
28+
- id: docker-test
29+
name: Test the image
30+
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
31+
if: steps.docker-build.outputs.skipped != 'true'
32+
- id: registry-login
33+
name: Login to the Docker Registry
34+
run: |
35+
echo "::add-mask::$DOCKERHUB_USERNAME"
36+
echo "::add-mask::$DOCKERHUB_PASSWORD"
37+
docker login -u "$DOCKERHUB_USERNAME" --password "${DOCKERHUB_PASSWORD}" "${DOCKER_REGISTRY}"
38+
env:
39+
DOCKERHUB_USERNAME: ${{ secrets.dockerhub_username }}
40+
DOCKERHUB_PASSWORD: ${{ secrets.dockerhub_password }}
41+
if: steps.docker-build.outputs.skipped != 'true'
42+
- id: registry-push
43+
name: Push the image
44+
run: ${{ matrix.build_cmd }} --push-only
45+
if: steps.docker-build.outputs.skipped != 'true'
46+
- id: registry-logout
47+
name: Logout of the Docker Registry
48+
run: docker logout "${DOCKER_REGISTRY}"
49+
if: steps.docker-build.outputs.skipped != 'true'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.sql.gz
22
.netbox
3+
.initializers
34
docker-compose.override.yml

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: /

Dockerfile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ WORKDIR /install
1818

1919
RUN pip install --prefix="/install" --no-warn-script-location \
2020
# gunicorn is used for launching netbox
21-
'gunicorn<20.0.0' \
21+
gunicorn \
2222
greenlet \
2323
eventlet \
2424
# napalm is used for gathering information from network devices
2525
napalm \
2626
# ruamel is used in startup_scripts
2727
'ruamel.yaml>=0.15,<0.16' \
2828
# django_auth_ldap is required for ldap
29-
django_auth_ldap
29+
django_auth_ldap \
30+
# django-storages was introduced in 2.7 and is optional
31+
django-storages
3032

3133
ARG NETBOX_PATH
3234
COPY ${NETBOX_PATH}/requirements.txt /
@@ -68,6 +70,13 @@ COPY configuration/configuration.py /etc/netbox/config/configuration.py
6870

6971
WORKDIR /opt/netbox/netbox
7072

73+
# Must set permissions for '/opt/netbox/netbox/static' directory
74+
# to g+w so that `./manage.py collectstatic` can be executed during
75+
# container startup.
76+
# Must set permissions for '/opt/netbox/netbox/media' directory
77+
# to g+w so that pictures can be uploaded to netbox.
78+
RUN mkdir static && chmod g+w static media
79+
7180
ENTRYPOINT [ "/opt/netbox/docker-entrypoint.sh" ]
7281

7382
CMD ["gunicorn", "-c /etc/netbox/config/gunicorn_config.py", "netbox.wsgi"]

README.md

Lines changed: 11 additions & 8 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
@@ -68,22 +68,25 @@ $ xdg-open "http://$(docker-compose port nginx 8080)/" &>/dev/null &
6868

6969
Alternatively, use something like [Reception][docker-reception] to connect to _docker-compose_ projects.
7070

71-
Default credentials:
71+
The default credentials are:
7272

7373
* Username: **admin**
7474
* Password: **admin**
7575
* API Token: **0123456789abcdef0123456789abcdef01234567**
7676

77+
There is a more complete [Getting Started guide on our Wiki][wiki-getting-started].
78+
79+
[wiki-getting-started]: https://github.com/netbox-community/netbox-docker/wiki/Getting-Started
7780
[docker-reception]: https://github.com/nxt-engineering/reception
7881

7982
## Dependencies
8083

81-
This project relies only on *Docker* and *docker-compose* meeting this requirements:
84+
This project relies only on *Docker* and *docker-compose* meeting these requirements:
8285

8386
* The *Docker version* must be at least `17.05`.
8487
* The *docker-compose version* must be at least `1.17.0`.
8588

86-
To ensure this, compare the output of `docker --version` and `docker-compose --version` with the requirements above.
89+
To check the version installed on your system run `docker --version` and `docker-compose --version`.
8790

8891
## Documentation
8992

@@ -100,7 +103,7 @@ To use this feature, set the environment-variable `VERSION` before launching `do
100103
[any tag of the `netboxcommunity/netbox` Docker image on Docker Hub][netbox-dockerhub].
101104

102105
```bash
103-
export VERSION=v2.6.7
106+
export VERSION=v2.7.1
104107
docker-compose pull netbox
105108
docker-compose up -d
106109
```
@@ -109,7 +112,7 @@ You can also build a specific version of the Netbox Docker image yourself.
109112
`VERSION` can be any valid [git ref][git-ref] in that case.
110113

111114
```bash
112-
export VERSION=v2.6.7
115+
export VERSION=v2.7.1
113116
./build.sh $VERSION
114117
docker-compose up -d
115118
```
@@ -123,7 +126,7 @@ From time to time it might become necessary to re-engineer the structure of this
123126
Things like the `docker-compose.yml` file or your Kubernetes or OpenShift configurations have to be adjusted as a consequence.
124127
Since November 2019 each image built from this repo contains a `org.opencontainers.image.version` label.
125128
(The images contained labels since April 2018, although in November 2019 the labels' names changed.)
126-
You can check the label of your local image by running `docker inspect netboxcommunity/netbox:v2.6.7 --format "{{json .ContainerConfig.Labels}}"`.
129+
You can check the label of your local image by running `docker inspect netboxcommunity/netbox:v2.7.1 --format "{{json .ContainerConfig.Labels}}"`.
127130

128131
Please read [the release notes][releases] carefully when updating to a new image version.
129132

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.20.0
1+
0.21.0

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-latest.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ if [ "${PRERELEASE}" == "true" ]; then
6666

6767
echo "❎ Latest unstable version '${VERSION}' is not higher than the latest stable version '$STABLE_VERSION'."
6868
if [ -z "$DEBUG" ]; then
69+
if [ -n "${GH_ACTION}" ]; then
70+
echo "::set-output name=skipped::true"
71+
fi
72+
6973
exit 0
7074
else
7175
echo "⚠️ Would exit here with code '0', but DEBUG is enabled."

0 commit comments

Comments
 (0)