Skip to content

Commit

Permalink
bump version to 1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bb-Ricardo committed Apr 9, 2022
1 parent def19fa commit d014311
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 14 deletions.
23 changes: 12 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ FROM python:3.9-slim-bullseye
# Install dependencies
RUN apt-get update && apt-get -y upgrade && apt-get install -y git-core

# Prepare the application
COPY . /app

# disable upgrading setup tools due to bug in setuptools and automation sdk
# once this is fixed, switch back to: pip3 install --upgrade pip setuptools
RUN cd /app && \
pip3 install --upgrade pip && \
pip3 install --force-reinstall 'setuptools==60.10.0' && \
pip3 install -r requirements.txt && \
pip3 install --upgrade git+https://github.com/vmware/vsphere-automation-sdk-python.git

# Run the application
WORKDIR /app

Expand All @@ -22,8 +11,20 @@ RUN set -eux; \
adduser --uid 1000 --ingroup netbox-sync --shell /bin/sh --home /home/netbox-sync --disabled-password \
--gecos "netbox-sync,0815,2342,9001" netbox-sync

# Prepare the application
COPY Dockerfile LICENSE.txt netbox-sync.py README.md requirements.txt settings-example.ini /app/
COPY module /app/module

RUN chown -R netbox-sync:netbox-sync /app

# disable upgrading setup tools due to bug in setuptools and automation sdk
# once this is fixed, switch back to: pip3 install --upgrade pip setuptools
RUN cd /app && \
pip3 install --upgrade pip && \
pip3 install --force-reinstall 'setuptools==60.10.0' && \
pip3 install -r requirements.txt && \
pip3 install --upgrade git+https://github.com/vmware/vsphere-automation-sdk-python.git

USER netbox-sync

ENTRYPOINT ["python3", "netbox-sync.py"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ usage: netbox-sync.py [-h] [-c settings.ini]
Sync objects from various sources to NetBox
Version: 1.2.2 (2022-01-27)
Version: 1.2.3 (2022-04-09)
Project URL: https://github.com/bb-ricardo/netbox-sync
optional arguments:
Expand Down
4 changes: 2 additions & 2 deletions netbox-sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
from module.sources import instantiate_sources


__version__ = "1.2.2"
__version_date__ = "2022-01-27"
__version__ = "1.2.3"
__version_date__ = "2022-04-09"
__author__ = "Ricardo Bartels <ricardo.bartels@telekom.de>"
__description__ = "NetBox Sync"
__license__ = "MIT"
Expand Down
17 changes: 17 additions & 0 deletions scripts/publish_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

IMAGE_NAME="bbricardo/netbox-sync"
IMAGE_TAG=$(grep "^__version__" netbox-sync.py | sed 's/__version__ = "\(.*\)"/\1/g')

if [[ -z "$IMAGE_TAG" ]]; then
echo "ERROR: unable to grep version from 'netbox-sync.py'"
exit 1
fi

find . -name "__pycache__" -delete
docker build -t "${IMAGE_NAME}:${IMAGE_TAG}" .
docker tag "${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:latest"
docker push "${IMAGE_NAME}:${IMAGE_TAG}"
docker push "${IMAGE_NAME}:latest"

docker-pushrm "$IMAGE_NAME"

0 comments on commit d014311

Please sign in to comment.