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.0rc6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc151cde17576d44679c8140dffd7725c4d608320cab1074c1e5520976a7056f |
|
MD5 | 7c0340eb6d804f07b890676076e7fae0 |
|
BLAKE2b-256 | 3378059d49c7f9693fc0e81af873f6a79864e8592b5f08f017abaefab0e8476c |
Hashes for netbox_docker_plugin-1.0.0rc6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dc57c67bdde2eabfdb632a7df07bb259941e5bea9a45474254d97da06ce8c05 |
|
MD5 | 4a6fce1e105ed85e9b272f98a0437b2c |
|
BLAKE2b-256 | c0146f0c8291a98a83b7254790e4e651bb766e19e84194c0351367cf035844fe |