Skip to content

Commit ebda466

Browse files
authored
Merge pull request #809 from netbox-community/develop
Version 2.1.0
2 parents b45934c + f44e377 commit ebda466

File tree

9 files changed

+334
-309
lines changed

9 files changed

+334
-309
lines changed

.github/workflows/push.yml

Lines changed: 56 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: push
23

34
on:
@@ -13,55 +14,66 @@ jobs:
1314
runs-on: ubuntu-latest
1415
name: Checks syntax of our code
1516
steps:
16-
- uses: actions/checkout@v3
17-
with:
18-
# Full git history is needed to get a proper list of changed files within `super-linter`
19-
fetch-depth: 0
20-
- uses: actions/setup-python@v4
21-
with:
22-
python-version: '3.9'
23-
- name: Lint Code Base
24-
uses: github/super-linter@v4
25-
env:
26-
DEFAULT_BRANCH: develop
27-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
SUPPRESS_POSSUM: true
29-
LINTER_RULES_PATH: /
30-
VALIDATE_ALL_CODEBASE: false
31-
VALIDATE_DOCKERFILE: false
32-
FILTER_REGEX_EXCLUDE: (.*/)?(LICENSE|configuration/.*)
33-
34-
EDITORCONFIG_FILE_NAME: .ecrc
35-
DOCKERFILE_HADOLINT_FILE_NAME: .hadolint.yaml
36-
MARKDOWN_CONFIG_FILE: .markdown-lint.yml
37-
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
38-
PYTHON_FLAKE8_CONFIG_FILE: .flake8
39-
PYTHON_ISORT_CONFIG_FILE: pyproject.toml
17+
- uses: actions/checkout@v3
18+
with:
19+
# Full git history is needed to get a proper
20+
# list of changed files within `super-linter`
21+
fetch-depth: 0
22+
- uses: actions/setup-python@v4
23+
with:
24+
python-version: '3.9'
25+
- name: Lint Code Base
26+
uses: github/super-linter@v4
27+
env:
28+
DEFAULT_BRANCH: develop
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
SUPPRESS_POSSUM: true
31+
LINTER_RULES_PATH: /
32+
VALIDATE_ALL_CODEBASE: false
33+
VALIDATE_DOCKERFILE: false
34+
FILTER_REGEX_EXCLUDE: (.*/)?(LICENSE|configuration/.*)
35+
EDITORCONFIG_FILE_NAME: .ecrc
36+
DOCKERFILE_HADOLINT_FILE_NAME: .hadolint.yaml
37+
MARKDOWN_CONFIG_FILE: .markdown-lint.yml
38+
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
39+
PYTHON_FLAKE8_CONFIG_FILE: .flake8
40+
PYTHON_ISORT_CONFIG_FILE: pyproject.toml
41+
YAML_CONFIG_FILE: .yamllint.yaml
4042
build:
41-
continue-on-error: ${{ matrix.docker_from == 'alpine:edge' }}
43+
continue-on-error: ${{ matrix.build_cmd != './build-latest.sh' }}
4244
strategy:
4345
matrix:
4446
build_cmd:
45-
- ./build-latest.sh
46-
- PRERELEASE=true ./build-latest.sh
47-
- ./build.sh feature
48-
- ./build.sh develop
49-
docker_from:
50-
- '' # use the default of the build script
47+
- ./build-latest.sh
48+
- PRERELEASE=true ./build-latest.sh
49+
- ./build.sh feature
50+
- ./build.sh develop
51+
platform:
52+
- linux/amd64
53+
- linux/arm64
5154
fail-fast: false
55+
env:
56+
GH_ACTION: enable
57+
IMAGE_NAMES: docker.io/netboxcommunity/netbox
5258
runs-on: ubuntu-latest
5359
name: Builds new NetBox Docker Images
5460
steps:
55-
- id: git-checkout
56-
name: Checkout
57-
uses: actions/checkout@v3
58-
- id: docker-build
59-
name: Build the image from '${{ matrix.docker_from }}' with '${{ matrix.build_cmd }}'
60-
run: ${{ matrix.build_cmd }}
61-
env:
62-
DOCKER_FROM: ${{ matrix.docker_from }}
63-
GH_ACTION: enable
64-
- id: docker-test
65-
name: Test the image
66-
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
67-
if: steps.docker-build.outputs.skipped != 'true'
61+
- id: git-checkout
62+
name: Checkout
63+
uses: actions/checkout@v3
64+
- id: qemu-setup
65+
name: Set up QEMU
66+
uses: docker/setup-qemu-action@v2
67+
- id: buildx-setup
68+
name: Set up Docker Buildx
69+
uses: docker/setup-buildx-action@v2
70+
- id: docker-build
71+
name: Build the image for '${{ matrix.platform }}' with '${{ matrix.build_cmd }}'
72+
run: ${{ matrix.build_cmd }}
73+
env:
74+
BUILDX_PLATFORM: ${{ matrix.platform }}
75+
BUILDX_BUILDER_NAME: ${{ steps.buildx-setup.outputs.name }}
76+
- id: docker-test
77+
name: Test the image
78+
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
79+
if: steps.docker-build.outputs.skipped != 'true'

.github/workflows/release.yml

Lines changed: 63 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: release
23

34
on:
@@ -6,82 +7,77 @@ on:
67
- published
78
schedule:
89
- cron: '45 5 * * *'
10+
workflow_dispatch:
911

1012
jobs:
1113
build:
1214
strategy:
1315
matrix:
1416
build_cmd:
15-
- ./build-latest.sh
16-
- PRERELEASE=true ./build-latest.sh
17-
- ./build.sh feature
18-
- ./build.sh develop
17+
- ./build-latest.sh
18+
- PRERELEASE=true ./build-latest.sh
19+
- ./build.sh feature
20+
- ./build.sh develop
21+
platform:
22+
- linux/amd64,linux/arm64
1923
fail-fast: false
2024
runs-on: ubuntu-latest
2125
name: Builds new NetBox Docker Images
2226
env:
2327
GH_ACTION: enable
28+
IMAGE_NAMES: docker.io/netboxcommunity/netbox quay.io/netboxcommunity/netbox ghcr.io/netbox-community/netbox
2429
steps:
25-
-
26-
name: Checkout
27-
uses: actions/checkout@v3
28-
-
29-
name: Get Version of NetBox Docker
30-
run: |
31-
echo "::set-output name=version::$(cat VERSION)"
32-
shell: bash
33-
-
34-
id: docker-build
35-
name: Build the image with '${{ matrix.build_cmd }}'
36-
run: ${{ matrix.build_cmd }}
37-
-
38-
name: Test the image
39-
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
40-
if: steps.docker-build.outputs.skipped != 'true'
41-
42-
# docker.io
43-
-
44-
name: Login to docker.io
45-
uses: docker/login-action@v2
46-
with:
47-
registry: docker.io
48-
username: ${{ secrets.dockerhub_username }}
49-
password: ${{ secrets.dockerhub_password }}
50-
if: steps.docker-build.outputs.skipped != 'true'
51-
-
52-
name: Push the image to docker.io
53-
run: ${{ matrix.build_cmd }} --push-only
54-
if: steps.docker-build.outputs.skipped != 'true'
55-
56-
# quay.io
57-
-
58-
name: Login to Quay.io
59-
uses: docker/login-action@v2
60-
with:
61-
registry: quay.io
62-
username: ${{ secrets.quayio_username }}
63-
password: ${{ secrets.quayio_password }}
64-
if: steps.docker-build.outputs.skipped != 'true'
65-
-
66-
name: Build and push the image with '${{ matrix.build_cmd }}'
67-
run: ${{ matrix.build_cmd }} --push
68-
env:
69-
DOCKER_REGISTRY: quay.io
70-
if: steps.docker-build.outputs.skipped != 'true'
71-
72-
# ghcr.io
73-
-
74-
name: Login to GitHub Container Registry
75-
uses: docker/login-action@v2
76-
with:
77-
registry: ghcr.io
78-
username: ${{ github.repository_owner }}
79-
password: ${{ secrets.GITHUB_TOKEN }}
80-
if: steps.docker-build.outputs.skipped != 'true'
81-
-
82-
name: Build and push the image with '${{ matrix.build_cmd }}'
83-
run: ${{ matrix.build_cmd }} --push
84-
env:
85-
DOCKER_REGISTRY: ghcr.io
86-
DOCKER_ORG: netbox-community
87-
if: steps.docker-build.outputs.skipped != 'true'
30+
- id: source-checkout
31+
name: Checkout
32+
uses: actions/checkout@v3
33+
- id: set-netbox-docker-version
34+
name: Get Version of NetBox Docker
35+
run: echo "::set-output name=version::$(cat VERSION)"
36+
shell: bash
37+
- id: qemu-setup
38+
name: Set up QEMU
39+
uses: docker/setup-qemu-action@v2
40+
- id: buildx-setup
41+
name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v2
43+
- id: docker-build
44+
name: Build the image with '${{ matrix.build_cmd }}'
45+
run: ${{ matrix.build_cmd }}
46+
- id: test-image
47+
name: Test the image
48+
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
49+
if: steps.docker-build.outputs.skipped != 'true'
50+
# docker.io
51+
- id: docker-io-login
52+
name: Login to docker.io
53+
uses: docker/login-action@v2
54+
with:
55+
registry: docker.io
56+
username: ${{ secrets.dockerhub_username }}
57+
password: ${{ secrets.dockerhub_password }}
58+
if: steps.docker-build.outputs.skipped != 'true'
59+
# quay.io
60+
- id: quay-io-login
61+
name: Login to Quay.io
62+
uses: docker/login-action@v2
63+
with:
64+
registry: quay.io
65+
username: ${{ secrets.quayio_username }}
66+
password: ${{ secrets.quayio_password }}
67+
if: steps.docker-build.outputs.skipped != 'true'
68+
# ghcr.io
69+
- id: ghcr-io-login
70+
name: Login to GitHub Container Registry
71+
uses: docker/login-action@v2
72+
with:
73+
registry: ghcr.io
74+
username: ${{ github.repository_owner }}
75+
password: ${{ secrets.GITHUB_TOKEN }}
76+
if: steps.docker-build.outputs.skipped != 'true'
77+
- id: build-and-push
78+
name: Push the image
79+
run: ${{ matrix.build_cmd }} --push
80+
if: steps.docker-build.outputs.skipped != 'true'
81+
env:
82+
BUILDX_PLATFORM: ${{ matrix.platform }}
83+
BUILDX_BUILDER_NAME: ${{ steps.buildx-setup.outputs.name }}

.yamllint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
3+
rules:
4+
line-length:
5+
max: 120

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,21 @@ RUN export DEBIAN_FRONTEND=noninteractive \
4343
--yes -qq --no-install-recommends \
4444
ca-certificates \
4545
curl \
46+
libldap-common \
4647
libpq5 \
4748
openssl \
4849
python3 \
4950
python3-distutils \
5051
tini \
5152
&& curl -sL https://nginx.org/keys/nginx_signing.key \
5253
> /etc/apt/trusted.gpg.d/nginx.asc && \
53-
echo "deb https://packages.nginx.org/unit/debian/ bullseye unit" \
54+
echo "deb https://packages.nginx.org/unit/ubuntu/ jammy unit" \
5455
> /etc/apt/sources.list.d/unit.list \
5556
&& apt-get update -qq \
5657
&& apt-get install \
5758
--yes -qq --no-install-recommends \
58-
unit=1.27.0-1~bullseye \
59-
unit-python3.9=1.27.0-1~bullseye \
59+
unit=1.27.0-1~jammy \
60+
unit-python3.10=1.27.0-1~jammy \
6061
&& rm -rf /var/lib/apt/lists/*
6162

6263
COPY --from=builder /opt/netbox/venv /opt/netbox/venv
@@ -85,7 +86,7 @@ RUN mkdir -p static /opt/unit/state/ /opt/unit/tmp/ \
8586
--config-file /opt/netbox/mkdocs.yml --site-dir /opt/netbox/netbox/project-static/docs/ \
8687
&& SECRET_KEY="dummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input
8788

88-
ENV LANG=C.UTF-8
89+
ENV LANG=C.UTF-8 PATH=/opt/netbox/venv/bin:$PATH
8990
ENTRYPOINT [ "/usr/bin/tini", "--" ]
9091

9192
CMD [ "/opt/netbox/docker-entrypoint.sh", "/opt/netbox/launch-netbox.sh" ]

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0
1+
2.1.0

build-functions/docker-functions.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)