Skip to content

Commit 86b68cb

Browse files
committed
Fixed the super-linter warnings
1 parent 166d587 commit 86b68cb

File tree

4 files changed

+121
-115
lines changed

4 files changed

+121
-115
lines changed

.github/workflows/push.yml

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

34
on:
@@ -13,66 +14,67 @@ 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
47+
- ./build-latest.sh
48+
- PRERELEASE=true ./build-latest.sh
49+
- ./build.sh feature
50+
- ./build.sh develop
4951
platform:
50-
- linux/amd64
51-
- linux/arm64
52+
- linux/amd64
53+
- linux/arm64
5254
fail-fast: false
5355
env:
5456
GH_ACTION: enable
5557
IMAGE_NAMES: docker.io/netboxcommunity/netbox
5658
runs-on: ubuntu-latest
5759
name: Builds new NetBox Docker Images
5860
steps:
59-
- id: git-checkout
60-
name: Checkout
61-
uses: actions/checkout@v3
62-
- id: qemu-setup
63-
name: Set up QEMU
64-
uses: docker/setup-qemu-action@v1
65-
- id: buildx-setup
66-
name: Set up Docker Buildx
67-
uses: docker/setup-buildx-action@v1
68-
- id: docker-build
69-
name: Build the image for '${{ matrix.platform }}' with '${{ matrix.build_cmd }}'
70-
run: ${{ matrix.build_cmd }}
71-
env:
72-
DOCKER_FROM: ${{ matrix.docker_from }}
73-
BUILDX_PLATFORM: ${{ matrix.platform }}
74-
BUILDX_BUILDER_NAME: ${{ steps.buildx-setup.outputs.name }}
75-
- id: docker-test
76-
name: Test the image
77-
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
78-
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@v1
67+
- id: buildx-setup
68+
name: Set up Docker Buildx
69+
uses: docker/setup-buildx-action@v1
70+
- id: docker-build
71+
name: Build the image for '${{ matrix.platform }}' with '${{ matrix.build_cmd }}'
72+
run: ${{ matrix.build_cmd }}
73+
env:
74+
DOCKER_FROM: ${{ matrix.docker_from }}
75+
BUILDX_PLATFORM: ${{ matrix.platform }}
76+
BUILDX_BUILDER_NAME: ${{ steps.buildx-setup.outputs.name }}
77+
- id: docker-test
78+
name: Test the image
79+
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
80+
if: steps.docker-build.outputs.skipped != 'true'

.github/workflows/release.yml

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

34
on:
@@ -13,71 +14,70 @@ jobs:
1314
strategy:
1415
matrix:
1516
build_cmd:
16-
- ./build-latest.sh
17-
- PRERELEASE=true ./build-latest.sh
18-
- ./build.sh feature
19-
- ./build.sh develop
17+
- ./build-latest.sh
18+
- PRERELEASE=true ./build-latest.sh
19+
- ./build.sh feature
20+
- ./build.sh develop
2021
platform:
21-
- linux/amd64,linux/arm64
22+
- linux/amd64,linux/arm64
2223
fail-fast: false
2324
runs-on: ubuntu-latest
2425
name: Builds new NetBox Docker Images
2526
env:
2627
GH_ACTION: enable
2728
IMAGE_NAMES: docker.io/netboxcommunity/netbox quay.io/netboxcommunity/netbox ghcr.io/netbox-community/netbox
2829
steps:
29-
- id: source-checkout
30-
name: Checkout
31-
uses: actions/checkout@v3
32-
- id: set-netbox-docker-version
33-
name: Get Version of NetBox Docker
34-
run: |
35-
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@v1
40-
- id: buildx-setup
41-
name: Set up Docker Buildx
42-
uses: docker/setup-buildx-action@v1
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 }}
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@v1
40+
- id: buildx-setup
41+
name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v1
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

build.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ develop)
231231
;;
232232
esac
233233

234-
235234
###
236235
# composing the final TARGET_DOCKER_TAG
237236
###
@@ -291,7 +290,7 @@ elif [[ "${IMAGE_NAME_TAGS[0]}" = docker.io* ]]; then
291290
# Need to use "library/..." for images the have no two part name
292291
DOCKER_FROM_SPLIT[0]="library/${DOCKER_FROM_SPLIT[0]}"
293292
fi
294-
IFS='/' read -ra ORG_REPO <<< "${IMAGE_NAMES[0]}"
293+
IFS='/' read -ra ORG_REPO <<<"${IMAGE_NAMES[0]}"
295294
echo "Checking labels for '${ORG_REPO[1]}' and '${ORG_REPO[2]}'"
296295
BASE_LAST_LAYER=$(get_image_last_layer "${DOCKER_FROM_SPLIT[0]}" "${DOCKER_FROM_SPLIT[1]}")
297296
mapfile -t IMAGES_LAYERS_OLD < <(get_image_layers "${ORG_REPO[1]}"/"${ORG_REPO[2]}" "${TAG}")
@@ -311,7 +310,7 @@ elif [[ "${IMAGE_NAME_TAGS[0]}" = docker.io* ]]; then
311310
BUILD_REASON="${BUILD_REASON} netbox-docker"
312311
fi
313312
else
314-
SHOULD_BUILD="true"
313+
SHOULD_BUILD="true"
315314
BUILD_REASON="${BUILD_REASON} no-check"
316315
fi
317316

@@ -413,7 +412,7 @@ $DRY docker buildx \
413412
.
414413
echo "✅ Finished building the Docker images"
415414
gh_echo "::endgroup::" # End group for Build
416-
415+
417416
gh_echo "::group::🏗 Image Labels"
418417
echo "🔎 Inspecting labels on '${IMAGE_NAME_TAGS[0]}'"
419418
$DRY docker inspect "${IMAGE_NAME_TAGS[0]}" --format "{{json .Config.Labels}}" | jq

0 commit comments

Comments
 (0)