From f0b828a61509dc8844e9887ae62e9a400f0c72f0 Mon Sep 17 00:00:00 2001 From: Laurent Ollagnier Date: Sun, 30 Nov 2025 10:22:53 +0100 Subject: [PATCH] scripts de gestion --- VContainers/build.sh | 13 +++++++++++++ VContainers/run.sh | 24 ++++++++++++++++++++++++ VContainers/stop.sh | 11 +++++++++++ 3 files changed, 48 insertions(+) create mode 100755 VContainers/build.sh create mode 100755 VContainers/run.sh create mode 100755 VContainers/stop.sh diff --git a/VContainers/build.sh b/VContainers/build.sh new file mode 100755 index 00000000..06b36478 --- /dev/null +++ b/VContainers/build.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +# Move to repository root +cd "$(dirname "$0")/.." + +echo "Building VNode..." +podman build . -f ./VContainers/VNode/Containerfile -t vnode + +echo "Building VApp..." +podman build . -f ./VContainers/VApp/Containerfile -t vapp + +echo "Build complete." diff --git a/VContainers/run.sh b/VContainers/run.sh new file mode 100755 index 00000000..eb94456f --- /dev/null +++ b/VContainers/run.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e + +# Move to repository root +cd "$(dirname "$0")/.." + +echo "Creating Pod vulture..." +# Check if pod exists to avoid error +if podman pod exists vulture; then + echo "Pod vulture already exists." +else + podman pod create --name vulture -p 8080:80 -p 1883:1883 -p 8081:8081 -p 8083:8083 -p 8883:8883 -p 9001:9001 +fi + +echo "Starting NanoMQ..." +podman run -dt --rm --pod vulture --name nanomq -v ./VContainers/MQTT/config/nanomq.conf:/etc/nanomq.conf docker.io/emqx/nanomq:latest --conf /etc/nanomq.conf + +echo "Starting VNode..." +podman run -dt --rm --pod vulture --name vnode vnode:latest + +echo "Starting VApp..." +podman run -dt --rm --pod vulture --name vapp vapp:latest + +echo "All containers started." diff --git a/VContainers/stop.sh b/VContainers/stop.sh new file mode 100755 index 00000000..0e93d036 --- /dev/null +++ b/VContainers/stop.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "Stopping containers..." +podman stop vapp || echo "vapp not running" +podman stop vnode || echo "vnode not running" +podman stop nanomq || echo "nanomq not running" + +echo "Removing pod..." +podman pod rm vulture || echo "Pod vulture not found" + +echo "Cleanup complete."