mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 03:16:25 -06:00
Update project scaffolding
* Use nginx for static files * Add netbox to docker-compose * Lint source code * Update nginx.conf to actually work * Build a base `branch` tag for latest of that branch
This commit is contained in:
parent
0c107767e3
commit
67cc069857
25
.jenkins
25
.jenkins
@ -71,11 +71,11 @@ spec:
|
||||
*/
|
||||
dir('netbox/netbox') {
|
||||
sh """
|
||||
cp configuration.example.py configuration.py
|
||||
sed -i -e "s/ALLOWED_HOSTS = .*/ALLOWED_HOSTS = ['*']/g" configuration.py
|
||||
sed -i -e "s/SECRET_KEY = .*/SECRET_KEY = 'netboxci'/g" configuration.py
|
||||
sed -i -e "s/USER': .*/USER': 'netbox',/g" configuration.py
|
||||
sed -i -e "s/PASSWORD': .*/PASSWORD': 'netbox',/g" configuration.py
|
||||
cp configuration.example.py configuration.py
|
||||
sed -i -e "s/ALLOWED_HOSTS = .*/ALLOWED_HOSTS = ['*']/g" configuration.py
|
||||
sed -i -e "s/SECRET_KEY = .*/SECRET_KEY = 'netboxci'/g" configuration.py
|
||||
sed -i -e "s/USER': .*/USER': 'netbox',/g" configuration.py
|
||||
sed -i -e "s/PASSWORD': .*/PASSWORD': 'netbox',/g" configuration.py
|
||||
"""
|
||||
}
|
||||
// finally, kick off tox to run the entire test suite
|
||||
@ -92,8 +92,11 @@ spec:
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
environment {
|
||||
BASE_TAG = getSafeBranchName()
|
||||
}
|
||||
agent {
|
||||
label 'docker-build'
|
||||
label 'docker-build'
|
||||
}
|
||||
steps {
|
||||
container('docker') {
|
||||
@ -106,10 +109,12 @@ spec:
|
||||
--build-arg BUILD_VERSION=${BUILD_TAG} \
|
||||
--build-arg BRANCH=${BRANCH_NAME} \
|
||||
-t ${IMAGE}:${TAG}
|
||||
'''
|
||||
withDockerRegistry(registry: [credentialsId: 'vio-docker-hub']) {
|
||||
sh "docker push ${env.IMAGE}:${env.TAG}"
|
||||
}
|
||||
'''
|
||||
sh 'docker tag ${IMAGE}:${TAG} ${IMAGE}:${BASE_TAG}'
|
||||
withDockerRegistry(registry: [credentialsId: 'vio-docker-hub']) {
|
||||
sh "docker push ${env.IMAGE}:${env.TAG}"
|
||||
sh "docker push ${env.IMAGE}:${env.BASE_TAG}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,6 @@ RUN wget -q -O - "${URL}" | tar xz \
|
||||
|
||||
COPY docker/configuration.docker.py /opt/netbox/netbox/netbox/configuration.py
|
||||
COPY docker/configuration/gunicorn_config.py /etc/netbox/config/
|
||||
COPY docker/nginx.conf /etc/netbox-nginx/nginx.conf
|
||||
COPY docker/docker-entrypoint.sh /opt/netbox/docker-entrypoint.sh
|
||||
COPY docker/startup_scripts/ /opt/netbox/startup_scripts/
|
||||
COPY docker/initializers/ /opt/netbox/initializers/
|
||||
|
@ -1,12 +1,38 @@
|
||||
version: '2'
|
||||
version: '3'
|
||||
services:
|
||||
postgres:
|
||||
image: "postgres:9.6"
|
||||
environment:
|
||||
POSTGRES_PASSWORD: "12345"
|
||||
POSTGRES_DB: netbox
|
||||
ports:
|
||||
- 5432:5432
|
||||
- 5432:5432
|
||||
redis:
|
||||
image: "redis"
|
||||
nginx:
|
||||
image: "nginx"
|
||||
volumes:
|
||||
- "static:/opt/netbox/netbox/static"
|
||||
- "./docker/nginx.conf:/etc/nginx/nginx.conf"
|
||||
ports:
|
||||
- 6379:6379
|
||||
- 8000:80
|
||||
netbox:
|
||||
image: "vaporio/netbox:develop.5"
|
||||
environment:
|
||||
SECRET_KEY: secret
|
||||
DB_HOST: postgres
|
||||
DB_USER: postgres
|
||||
DB_PASSWORD: "12345"
|
||||
ALLOWED_HOSTS: "*"
|
||||
REDIS_HOST: redis
|
||||
depends_on:
|
||||
- redis
|
||||
- postgres
|
||||
volumes:
|
||||
- "./netbox:/opt/netbox/netbox"
|
||||
- "static:/opt/netbox/netbox/static"
|
||||
- "./docker/configuration.docker.py:/opt/netbox/netbox/netbox/configuration.py"
|
||||
- "./docker/startup_scripts/:/opt/netbox/startup_scripts"
|
||||
- "./docker/initializers/:/opt/netbox/initializers"
|
||||
volumes:
|
||||
static:
|
||||
|
@ -1,4 +1,3 @@
|
||||
daemon off;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /dev/stderr info;
|
||||
@ -18,7 +17,7 @@ http {
|
||||
client_max_body_size 10M;
|
||||
|
||||
server {
|
||||
listen 8080;
|
||||
listen 80;
|
||||
access_log off;
|
||||
|
||||
location /static/ {
|
||||
|
@ -408,7 +408,7 @@ SITE_ID = 1
|
||||
# Django Allauth
|
||||
#
|
||||
|
||||
ACCOUNT_DEFAULT_HTTP_PROTOCOL='https'
|
||||
ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'https'
|
||||
LOGIN_REDIRECT_URL = 'home'
|
||||
|
||||
#
|
||||
|
@ -71,10 +71,10 @@ class VaporTestInterfaces(APITestCase):
|
||||
tenant=cls.customer1,
|
||||
)
|
||||
cls.device2 = Device.objects.create(
|
||||
name='network-locker2',
|
||||
device_role=cls.devicerole1,
|
||||
device_type=cls.devicetype1,
|
||||
site=cls.site1,
|
||||
name='network-locker2',
|
||||
device_role=cls.devicerole1,
|
||||
device_type=cls.devicetype1,
|
||||
site=cls.site1,
|
||||
)
|
||||
cls.interface1 = Interface.objects.create(name='e1', device=cls.device1)
|
||||
cls.interface2 = Interface.objects.create(name='xe-0/0/0', device=cls.device2)
|
||||
|
Loading…
Reference in New Issue
Block a user