Skip to content

Commit 29d9059

Browse files
authored
Merge branch 'main' into main
2 parents 0d037c2 + e972c94 commit 29d9059

40 files changed

Lines changed: 592 additions & 71 deletions

.github/workflows/docker-image.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Build netbox-sync docker image
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.[0-9]+.[0-9]+
7+
branches:
8+
- development
9+
paths:
10+
- .github/**
11+
- module/**
12+
- netbox-sync.py
13+
- requirements.txt
14+
workflow_dispatch:
15+
16+
jobs:
17+
build-and-push:
18+
runs-on: ubuntu-latest
19+
20+
permissions:
21+
contents: read
22+
packages: write
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v6
27+
28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Lower case docker image name
35+
id: docker_image
36+
uses: ASzc/change-string-case-action@v6
37+
with:
38+
string: ${{ github.repository }}
39+
40+
- name: set dockerhub repo name
41+
uses: mad9000/actions-find-and-replace-string@5
42+
id: dockerhub_image
43+
with:
44+
source: ${{ steps.docker_image.outputs.lowercase }}
45+
find: 'bb-ricardo'
46+
replace: ${{ vars.DOCKER_HUB_USERNAME }}
47+
48+
- name: Log in to GitHub Container Registry
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ghcr.io
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Docker meta GitHub Container Registry
56+
id: meta
57+
uses: docker/metadata-action@v5
58+
with:
59+
images: ghcr.io/${{ steps.docker_image.outputs.lowercase }}
60+
tags: |
61+
type=semver,pattern={{version}}
62+
type=ref,event=branch
63+
64+
- name: Build and push with tags - ${{ steps.meta.outputs.tags }}
65+
uses: docker/build-push-action@v6
66+
with:
67+
context: .
68+
push: true
69+
platforms: linux/amd64,linux/arm64
70+
tags: ${{ steps.meta.outputs.tags }}
71+
labels: ${{ steps.meta.outputs.labels }}
72+
73+
- name: Log in to Docker Hub
74+
uses: docker/login-action@v3
75+
with:
76+
username: ${{ vars.DOCKER_HUB_USERNAME }}
77+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
78+
79+
- name: Docker hub meta
80+
id: meta_dhub
81+
uses: docker/metadata-action@v5
82+
with:
83+
images: docker.io/${{ steps.dockerhub_image.outputs.value }}
84+
tags: |
85+
type=semver,pattern={{version}}
86+
type=ref,event=branch
87+
88+
- name: Build and push with tags - ${{ steps.dockerhub_image.outputs.value }}
89+
uses: docker/build-push-action@v6
90+
with:
91+
context: .
92+
push: true
93+
platforms: linux/amd64,linux/arm64
94+
tags: ${{ steps.meta_dhub.outputs.tags }}
95+
labels: ${{ steps.meta_dhub.outputs.labels }}
96+
97+
# - name: push README to Dockerhub
98+
# uses: christian-korneck/update-container-description-action@v1
99+
# env:
100+
# DOCKER_USER: ${{ vars.DOCKER_HUB_USERNAME }}
101+
# DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
102+
# with:
103+
# destination_container_repo: ${{ steps.dockerhub_image.outputs.value }}
104+
# provider: dockerhub

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
FROM python:3.11-slim-bookworm AS builder
1+
FROM python:3.13-slim AS builder
22

33
COPY requirements.txt .
44

55
ARG VENV=/opt/netbox-sync/venv
66

77
# Install dependencies
8-
RUN apt-get update && apt-get install -y --no-install-recommends git && \
8+
RUN apt-get update && apt-get install -y --no-install-recommends git gcc libc-dev && \
99
rm -rf /var/lib/apt/lists/* && \
1010
python3 -m venv $VENV && \
1111
$VENV/bin/python3 -m pip install --upgrade pip && \
1212
$VENV/bin/pip install -r requirements.txt && \
1313
$VENV/bin/pip install --upgrade git+https://github.com/vmware/vsphere-automation-sdk-python.git && \
1414
find $VENV -type d -name "__pycache__" -print0 | xargs -0 -n1 rm -rf
1515

16-
FROM python:3.11-slim-bookworm AS netbox-sync
16+
FROM python:3.13-slim AS netbox-sync
1717

1818
ARG VENV=/opt/netbox-sync/venv
1919

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,18 @@ usage: netbox-sync.py [-h] [-c settings.ini [settings.ini ...]] [-g]
9999
100100
Sync objects from various sources to NetBox
101101
102-
Version: 1.8.0 (2025-03-07)
102+
Version: 1.8.1 (2026-03-18)
103103
Project URL: https://github.com/bb-ricardo/netbox-sync
104104
105105
options:
106106
-h, --help show this help message and exit
107-
-c settings.ini [settings.ini ...], --config settings.ini [settings.ini ...]
107+
-c, --config settings.ini [settings.ini ...]
108108
points to the config file to read config data from
109109
which is not installed under the default path
110110
'./settings.ini'
111111
-g, --generate_config
112112
generates default config file.
113-
-l {DEBUG3,DEBUG2,DEBUG,INFO,WARNING,ERROR}, --log_level {DEBUG3,DEBUG2,DEBUG,INFO,WARNING,ERROR}
113+
-l, --log_level {DEBUG3,DEBUG2,DEBUG,INFO,WARNING,ERROR}
114114
set log level (overrides config)
115115
-n, --dry_run Operate as usual but don't change anything in NetBox.
116116
Great if you want to test and see what would be

module/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
2+
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
33
#
44
# netbox-sync.py
55
#
66
# This work is licensed under the terms of the MIT license.
77
# For a copy, see file LICENSE.txt included in this
88
# repository or visit: <https://opensource.org/licenses/MIT>.
99

10-
__version__ = "1.8.0"
11-
__version_date__ = "2025-03-07"
10+
__version__ = "1.8.1"
11+
__version_date__ = "2026-03-18"
1212
__author__ = "Ricardo Bartels <ricardo.bartels@telekom.de>"
1313
__description__ = "NetBox Sync"
1414
__license__ = "MIT"

module/common/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
2+
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
33
#
44
# netbox-sync.py
55
#

module/common/cli_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
2+
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
33
#
44
# netbox-sync.py
55
#

module/common/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
2+
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
33
#
44
# netbox-sync.py
55
#

module/common/logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
2+
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
33
#
44
# netbox-sync.py
55
#

module/common/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
2+
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
33
#
44
# netbox-sync.py
55
#

module/common/support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (c) 2020 - 2025 Ricardo Bartels. All rights reserved.
2+
# Copyright (c) 2020 - 2026 Ricardo Bartels. All rights reserved.
33
#
44
# netbox-sync.py
55
#

0 commit comments

Comments
 (0)