Improved deploy and build scripts

This commit is contained in:
2025-12-29 14:06:49 +01:00
parent db9e2bf87a
commit a54c8e566b
3 changed files with 29 additions and 21 deletions

View File

@@ -1,19 +0,0 @@
#!/bin/bash
GIT_HASH=$(git rev-parse --short HEAD)
docker-compose stop routermon
docker-compose stop upsmon
docker container prune
echo "Building UPSmon"
cp ../pyutils/utils.py ../upsmon/
docker build --build-arg BUILD_VER=${GIT_HASH} -f ../upsmon/upsmon.Dockerfile -t upsmon:influx3 ../upsmon
rm ../upsmon/utils.py
echo "Building Routermon"
cp ../pyutils/utils.py ../routermon/
docker build --build-arg BUILD_VER=${GIT_HASH} -f ../routermon/routermon.Dockerfile -t routermon:influx3 ../routermon
rm ../routermon/utils.py
docker-compose up -d

13
docker/deploy.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
GIT_HASH=$(git rev-parse --short HEAD)
cp ../pyutils/utils.py ../upsmon/
cp ../pyutils/utils.py ../routermon/
docker compose build --build-arg BUILD_VER=${GIT_HASH}
rm ../upsmon/utils.py
rm ../routermon/utils.py
docker compose up -d

View File

@@ -3,6 +3,10 @@ services:
image: influxdb:3-core image: influxdb:3-core
container_name: edx-influxdb3 container_name: edx-influxdb3
restart: unless-stopped restart: unless-stopped
ulimits:
nofile:
soft: 65536
hard: 65536
ports: ports:
- 8181:8181 - 8181:8181
command: command:
@@ -38,7 +42,12 @@ services:
max-file: "5" max-file: "5"
upsmon: upsmon:
image: upsmon:influx3 build:
context: ../upsmon
dockerfile: ../upsmon/upsmon.Dockerfile
args:
BUILD_VER:
#image: upsmon:influx3
container_name: edx-upsmon container_name: edx-upsmon
restart: unless-stopped restart: unless-stopped
depends_on: depends_on:
@@ -62,7 +71,12 @@ services:
- LOG_CLI_LVL=INFO - LOG_CLI_LVL=INFO
routermon: routermon:
image: routermon:influx3 build:
context: ../routermon
dockerfile: ../routermon/routermon.Dockerfile
args:
BUILD_VER:
#image: routermon:influx3
container_name: edx-routermon container_name: edx-routermon
restart: unless-stopped restart: unless-stopped
depends_on: depends_on: