Skip to content
Snippets Groups Projects
Commit b8eed86e authored by Fabian Herbert's avatar Fabian Herbert
Browse files

fix makefile, Netbox starts now

parent 7885d6be
No related branches found
No related tags found
1 merge request!1258Inventory Manager with Netbox
Pipeline #283631 failed
......@@ -8,7 +8,8 @@ TARGET_DIR=../../../gosdn/internal/netboxapi
NETBOX_VERSION=4.2.8
NETBOX_DOCKER_VERSION=3.2.0
GOIMPORTS := $(shell go env GOPATH)/bin/goimports
USER_NAME := fabii
USER_NAME := fabi
CONFIG_DIR=../../applications/inventory-manager-netbox/config/configNetbox.yaml
.PHONY: reset
......@@ -95,7 +96,6 @@ build:
goimports -w $$(find . -name '*.go')
.PHONY: copy
copy:
@echo ">> Copying generated API to $(TARGET_DIR)..."
......@@ -116,9 +116,9 @@ clean:
.PHONY: netboxstarten
netboxstarten:
@echo ">> PULL NetBox Docker with..."
cd ../../../netbox-docker && docker compose pull -d
cd ../../../netbox-docker && docker compose pull
@echo ">> UP NetBox Docker with..."
cd ../../../netbox-docker && docker compose up -d
cd ../../../netbox-docker && docker compose up
@echo ">> NetBox Docker started."
@echo ">> http://127.0.0.1:8000/
......@@ -129,7 +129,7 @@ netboxsuperuser:
cd ../../../netbox-docker && docker compose exec netbox /opt/netbox/netbox/manage.py createsuperuser --username $(USER_NAME) --email $(USER_NAME)@example.com
.PHONY: netboxToken
.PHONY: netboxToken
netboxToken:
@echo ">> Creating API token for user '$(USER_NAME)'..."
docker compose -f ../../../netbox-docker/docker-compose.yml exec netbox /opt/netbox/netbox/manage.py shell -c "\
......@@ -142,6 +142,7 @@ print(token.key)" > .tmp_token.txt && \
TOKEN=$$(tail -n1 .tmp_token.txt) && \
rm .tmp_token.txt && \
mkdir -p ../../applications/inventory-manager-netbox/config && \
echo "NetboxAddress: \"127.0.0.1:8000\"" > ../../applications/inventory-manager-netbox/config/configNetbox.yaml && \
echo "ApiToken: \"$$TOKEN\"" >> ../../applications/inventory-manager-netbox/config/configNetbox.yaml && \
echo "✅ Token written to configNetbox.yaml"
echo "NetboxAddress: \"127.0.0.1:8000\"" > $(CONFIG_DIR) && \
echo "ApiToken: \"$$TOKEN\"" >> $(CONFIG_DIR) && \
echo "Token written to configNetbox.yaml complete"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment