Manage Docker with Netbox & style.
Project description
Netbox Docker Plugin
Manage Docker with Netbox & style.
Contribute
Install our development environment
Requirements:
- Python 3.11
- PostgreSQL 15 Official Netbox doc
- user: netbox (with database creation right)
- password: secret
- database: netbox
- port: 5432
- Redis 7.2
- port: 6379
Set a PROJECT variable :
PROJECT="/project/netbox"
Create a project directory $PROJECT
:
mkdir $PROJECT
Go inside your project directory, clone this repository and the Netbox repository:
cd $PROJECT
git@github.com:SaaShup/netbox-docker-plugin.git
git clone git@github.com:netbox-community/netbox.git
Create your venv and activate it:
python -m venv venv
source venv/bin/activate
Install netbox-docker-plugin dependencies:
cd $PROJECT/netbox-docker-plugin
pip install -e .
Configure Netbox and install Netbox dependencies:
cd $PROJECT/netbox
cp $PROJECT/netbox-docker-plugin/netbox_configuration/configuration_dev.py $PROJECT/netbox/netbox/netbox/configuration.py
pip install -r requirements.txt
Run database migrations:
cd $PROJECT/netbox
python3 netbox/manage.py migrate
Create a Netbox super user:
cd $PROJECT/netbox
python3 netbox/manage.py createsuperuser
Start Netbox instance:
cd $PROJECT/netbox
python3 netbox/manage.py runserver 0.0.0.0:8000 --insecure
Visit http://localhost:8000/
Run tests
After installing you development environment, you can run the tests plugin (you don't need to start the Netbox instance):
cd $PROJECT/netbox
python3 netbox/manage.py test netbox_docker_plugin.tests --keepdb -v 2
With code coverage, install coverage.py and use it:
cd $PROJECT/netbox
python3 -m pip install coverage
The run the test with coverage.py and print the report:
cd $PROJECT/netbox
coverage run --include='*/netbox_docker_plugin/*' netbox/manage.py test netbox_docker_plugin.tests --keepdb -v 2
coverage report -m
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for netbox-docker-plugin-1.0.0rc4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86b2281248ead5b5c8de7e9a2795a151d69ee8e3e418d7034dea80448b3c2b8b |
|
MD5 | d59cdda041cb9d0d95779889e5b29478 |
|
BLAKE2b-256 | dd474b17924cf6c1d2d099aec4bbed752a42fbd95d48e5bc2edfe6edd2678ff8 |
Hashes for netbox_docker_plugin-1.0.0rc4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c43c10585e511acc1a59a8795a98c89ca280e1768a486b617ee06165e53e77f |
|
MD5 | a6ed71f3fdb81198640b52b41b93f0b2 |
|
BLAKE2b-256 | 959164b95b38a5571ebddce14f248826869f1e9daaadfce36dab5ab06b3c2b3b |