separate podman pod creation in several files
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s

This commit is contained in:
Thomas Peetz
2026-09-15 13:42:09 +02:00
parent d80aefe6b2
commit 0ad1969614
17 changed files with 541 additions and 353 deletions
+5 -5
View File
@@ -14,11 +14,11 @@ cd kontor-spring
./gradlew bootJar
cd ..
buildah build -f Containerfile.local -t kontor-spring:$kontorVersion kontor-spring
echo " => Baue Python Library kontor-model:$kontorVersion"
cd kontor-model
uv sync
uv publish --index nexus
cd ..
#echo " => Baue Python Library kontor-model:$kontorVersion"
#cd kontor-model
#uv sync
#uv publish --index nexus
#cd ..
echo " => Baue Image localhost/kontor-api:$kontorVersion"
buildah build -t kontor-api:$kontorVersion kontor-api
echo " => Baue Image localhost/kontor-quarkus:$kontorVersion"
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
# script/setup: Set up container for the first time after cloning
set -e
cd "$(dirname "$0")/.."
source version
script/bootstrap
echo "==> Setting up container activemq"
if podman container exists activemq; then
if podman ps -q --filter "name=activemq"; then
echo " => adminer is running"
fi
else
podman run -d --replace --pod kontor --name activemq \
-v activemq-data:/var/lib/artemis-instance \
docker.io/apache/activemq-artemis:latest-alpine
fi
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
# script/setup: Set up container for the first time after cloning
set -e
cd "$(dirname "$0")/.."
source version
script/bootstrap
echo "==> Setting up container kontor-angular"
if podman image exists localhost/kontor-angular:$kontorVersion; then
echo " => Image localhost/kontor-angular:$kontorVersion available"
fi
if podman container exists kontor-angular; then
if podman ps -q --filter "name=kontor-angular"; then
echo " => kontor-angular is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-angular \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-angular.service" \
localhost/kontor-angular:$kontorVersion
fi
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
# script/setup: Set up container for the first time after cloning
set -e
cd "$(dirname "$0")/.."
source version
script/bootstrap
echo "==> Setting up container kontor-api"
if podman image exists localhost/kontor-api:$kontorVersion; then
echo " => Image localhost/kontor-api:$kontorVersion available"
fi
if podman container exists kontor-api; then
if podman ps -q --filter "name=kontor-api"; then
echo " => kontor-api is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-api \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-api.service" \
--health-cmd='curl -f http://kontor-api:8200/health || exit 1' \
--health-interval=1s \
--health-timeout=5s \
--health-retries=10 \
localhost/kontor-api:$kontorVersion
fi
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
# script/setup: Set up container for the first time after cloning
set -e
cd "$(dirname "$0")/.."
source version
script/bootstrap
echo "==> Setting up container kontor-echo"
if podman image exists localhost/kontor-echo:$kontorVersion; then
echo " => Image localhost/kontor-echo:$kontorVersion available"
fi
if podman container exists kontor-echo; then
if podman ps -q --filter "name=kontor-echo"; then
echo " => kontor-echo is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-echo \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-echo.service" \
--health-cmd='curl -f http://kontor-echo:8400/health || exit 1' \
--health-interval=1s \
--health-timeout=5s \
--health-retries=10 \
localhost/kontor-echo:$kontorVersion
fi
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
# script/setup: Set up container for the first time after cloning
set -e
cd "$(dirname "$0")/.."
source version
script/bootstrap
echo "==> Setting up container kontor-fiber"
if podman image exists localhost/kontor-fiber:$kontorVersion; then
echo " => Image localhost/kontor-fiber:$kontorVersion available"
fi
if podman container exists kontor-fiber; then
if podman ps -q --filter "name=kontor-fiber"; then
echo " => kontor-fiber is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-fiber \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-fiber.service" \
--health-cmd='curl -f http://kontor-echo:8500/health || exit 1' \
--health-interval=1s \
--health-timeout=5s \
--health-retries=10 \
localhost/kontor-fiber:$kontorVersion
fi
+36
View File
@@ -0,0 +1,36 @@
#!/bin/bash
# script/setup: Set up container for the first time after cloning
set -e
cd "$(dirname "$0")/.."
source version
script/bootstrap
#script/cibuild
echo "==> Setting up container kontor-javalin"
if podman image exists localhost/kontor-javalin:$kontorVersion; then
echo " => Image localhost/kontor-javalin:$kontorVersion available"
fi
if podman container exists kontor-javalin; then
if podman ps -q --filter "name=kontor-javalin"; then
echo " => kontor-javalin is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-javalin \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-javalin.service" \
--health-cmd='curl -f http://kontor-echo:8600/health || exit 1' \
--health-interval=1s \
--health-timeout=5s \
--health-retries=10 \
localhost/kontor-javalin:$kontorVersion
fi
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
# script/setup: Set up container for the first time after cloning
set -e
cd "$(dirname "$0")/.."
source version
script/bootstrap
echo "==> Setting up container kontor-quarkus"
if podman image exists localhost/kontor-quarkus:$kontorVersion; then
echo " => Image localhost/kontor-quarkus:$kontorVersion available"
fi
if podman container exists kontor-quarkus; then
if podman ps -q --filter "name=kontor-quarkus"; then
echo " => kontor-quarkus is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-quarkus \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-quarkus.service" \
--health-cmd='curl -f http://kontor-quarkus:8300/q/health || exit 1' \
--health-interval=1s \
--health-timeout=5s \
--health-retries=10 \
localhost/kontor-quarkus:$kontorVersion
fi
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
# script/setup: Set up container for the first time after cloning
set -e
cd "$(dirname "$0")/.."
source version
script/bootstrap
echo "==> Setting up container kontor-spring"
if podman image exists localhost/kontor-spring:i$kontorVersion; then
echo " => Image localhost/kontor-spring:$kontorVersion available"
fi
if podman container exists kontor-spring; then
if podman ps -q --filter "name=kontor-spring"; then
echo " => kontor-spring is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-spring \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-spring.service" \
localhost/kontor-spring:$kontorVersion
fi
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
# script/setup: Set up container for the first time after cloning
set -e
cd "$(dirname "$0")/.."
source version
script/bootstrap
echo "==> Setting up container kontor-vue"
if podman image exists localhost/kontor-vue:$kontorVersion; then
echo " => Image localhost/kontor-vue:$kontorVersion available"
fi
if podman container exists kontor-vue; then
if podman ps -q --filter "name=kontor-vue"; then
echo " => kontor-vue is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-vue \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-vue.service" \
localhost/kontor-vue:$kontorVersion
fi
+58
View File
@@ -0,0 +1,58 @@
#!/bin/bash
# script/setup: Set up container for the first time after cloning
set -e
cd "$(dirname "$0")/.."
source version
script/bootstrap
echo "==> Setting up container postgres"
if podman container exists postgres; then
if podman ps -q --filter "name=postgres"; then
echo " => postgres is running"
fi
else
if podman secret exists pg_password; then
echo " => secret exists"
else
echo "kontor" | podman secret create pg_password -
fi
podman run -d --replace --pod kontor --name postgres \
--secret source=pg_password,type=env,target=POSTGRES_PASSWORD \
-e POSTGRES_DB=kontor \
-e POSTGRES_USER=kontor \
-e POSTGRES_HOST_AUTH_METHOD=scram-sha-256 \
-v kontor-db:/var/lib/postgresql/data \
--health-cmd='pg_isready -U kontor || exit 1' \
--health-interval=1s \
--health-timeout=5s \
--health-retries=10 \
docker.io/library/postgres:17
fi
echo "==> Setting up container adminer"
if podman container exists adminer; then
if podman ps -q --filter "name=adminer"; then
echo " => adminer is running"
fi
else
podman run -d --replace --pod kontor --name adminer docker.io/library/adminer
fi
echo "==> Setting up container pgadmin"
if podman container exists pgadmin; then
if podman ps -q --filter "name=pgadmin"; then
echo " => pgadmin is running"
fi
else
podman run -d --replace --pod kontor --name pgadmin \
-e 'PGADMIN_DEFAULT_EMAIL=thomas.peetz@thpeetz.de' \
-e 'PGADMIN_DEFAULT_PASSWORD=kontor' \
docker.io/dpage/pgadmin4:latest
fi
+39
View File
@@ -0,0 +1,39 @@
#!/bin/bash
# script/create_pod_kontor: Set up container for the first time after cloning
set -e
cd "$(dirname "$0")/.."
source version
echo "==> Setting up pod kontor"
if podman pod exists kontor; then
echo " => pod kontor exists"
if podman pod ps --filter "name=kontor" --filter "status=running"; then
echo " => pod kontor is running"
else
podman pod start kontor
fi
else
podman pod create --name kontor \
--infra \
-p 5432:5432 \
-p 8100:8100 \
-p 8200:8200 \
-p 8300:8300 \
-p 8400:8400 \
-p 8500:8500 \
-p 8600:8600 \
-p 8700:8700 \
-p 8800:8800 \
-p 8900:8080 \
-p 9876:80 \
-p 61616:61616 \
-p 8161:8161 \
-p 5672:5672 \
--network bridge
fi
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
# script/setup: Set up container for the first time after cloning
set -e
cd "$(dirname "$0")/.."
source version
echo "==> Setting up volume kontor-db"
if podman volume exists kontor-db; then
echo " => volume kontor-db exists"
else
podman volume create kontor-db
fi
echo "==> Setting up volume activemq-data"
if podman volume exists activemq-data; then
echo " => volume kontor-db exists"
else
podman volume create activemq-data
fi
+12 -232
View File
@@ -12,247 +12,27 @@ script/bootstrap
#script/cibuild
script/create_pod_kontor
echo "==> Setting up pod kontor"
if podman pod exists kontor; then
echo " => pod kontor exists"
if podman pod ps --filter "name=kontor" --filter "status=running"; then
echo " => pod kontor is running"
else
podman pod start kontor
fi
else
podman pod create --name kontor \
--infra \
-p 5432:5432 \
-p 8100:8100 \
-p 8200:8200 \
-p 8300:8300 \
-p 8400:8400 \
-p 8500:8500 \
-p 8600:8600 \
-p 8700:8700 \
-p 8800:8800 \
-p 8900:8080 \
-p 61616:61616 \
-p 8161:8161 \
-p 5672:5672 \
--network bridge
fi
script/create_volumes
echo "==> Setting up volume kontor-db"
if podman volume exists kontor-db; then
echo " => volume kontor-db exists"
else
podman volume create kontor-db
fi
script/create_container_postgres
echo "==> Setting up volume activemq-data"
if podman volume exists activemq-data; then
echo " => volume kontor-db exists"
else
podman volume create activemq-data
fi
script/create_container_activemq
echo "==> Setting up container postgres"
if podman container exists postgres; then
if podman ps -q --filter "name=postgres"; then
echo " => postgres is running"
fi
else
podman run -d --replace --pod kontor --name postgres \
-e POSTGRES_PASSWORD=kontor \
-e POSTGRES_DB=kontor \
-e POSTGRES_USER=kontor \
-v kontor-db:/var/lib/postgresql/data \
--health-cmd='pg_isready -U kontor || exit 1' \
--health-interval=1s \
--health-timeout=5s \
--health-retries=10 \
docker.io/library/postgres:17
fi
script/create_container_kontor-spring
echo "==> Setting up container adminer"
if podman container exists adminer; then
if podman ps -q --filter "name=adminer"; then
echo " => adminer is running"
fi
else
podman run -d --replace --pod kontor --name adminer docker.io/library/adminer
fi
script/create_container_kontor-api
echo "==> Setting up container activemq"
if podman container exists activemq; then
if podman ps -q --filter "name=activemq"; then
echo " => adminer is running"
fi
else
podman run -d --replace --pod kontor --name activemq \
-v activemq-data:/var/lib/artemis-instance \
docker.io/apache/activemq-artemis:latest-alpine
fi
script/create_container_kontor-quarkus
echo "==> Setting up container kontor-spring"
if podman image exists localhost/kontor-spring:i$kontorVersion; then
echo " => Image localhost/kontor-spring:$kontorVersion available"
fi
if podman container exists kontor-spring; then
if podman ps -q --filter "name=kontor-spring"; then
echo " => kontor-spring is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-spring \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-spring.service" \
localhost/kontor-spring:$kontorVersion
fi
script/create_container_kontor-echo
echo "==> Setting up container kontor-api"
if podman image exists localhost/kontor-api:$kontorVersion; then
echo " => Image localhost/kontor-api:$kontorVersion available"
fi
if podman container exists kontor-api; then
if podman ps -q --filter "name=kontor-api"; then
echo " => kontor-api is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-api \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-api.service" \
--health-cmd='curl -f http://kontor-api:8200/health || exit 1' \
--health-interval=1s \
--health-timeout=5s \
--health-retries=10 \
localhost/kontor-api:$kontorVersion
fi
script/create_container_kontor-fiber
echo "==> Setting up container kontor-quarkus"
if podman image exists localhost/kontor-quarkus:$kontorVersion; then
echo " => Image localhost/kontor-quarkus:$kontorVersion available"
fi
if podman container exists kontor-quarkus; then
if podman ps -q --filter "name=kontor-quarkus"; then
echo " => kontor-quarkus is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-quarkus \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-quarkus.service" \
--health-cmd='curl -f http://kontor-quarkus:8300/q/health || exit 1' \
--health-interval=1s \
--health-timeout=5s \
--health-retries=10 \
localhost/kontor-quarkus:$kontorVersion
fi
script/create_container_kontor-javalin
echo "==> Setting up container kontor-echo"
if podman image exists localhost/kontor-echo:$kontorVersion; then
echo " => Image localhost/kontor-echo:$kontorVersion available"
fi
if podman container exists kontor-echo; then
if podman ps -q --filter "name=kontor-echo"; then
echo " => kontor-echo is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-echo \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-echo.service" \
--health-cmd='curl -f http://kontor-echo:8400/health || exit 1' \
--health-interval=1s \
--health-timeout=5s \
--health-retries=10 \
localhost/kontor-echo:$kontorVersion
fi
script/create_container_kontor-vue
echo "==> Setting up container kontor-fiber"
if podman image exists localhost/kontor-fiber:$kontorVersion; then
echo " => Image localhost/kontor-fiber:$kontorVersion available"
fi
if podman container exists kontor-fiber; then
if podman ps -q --filter "name=kontor-fiber"; then
echo " => kontor-fiber is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-fiber \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-fiber.service" \
--health-cmd='curl -f http://kontor-echo:8500/health || exit 1' \
--health-interval=1s \
--health-timeout=5s \
--health-retries=10 \
localhost/kontor-fiber:$kontorVersion
fi
echo "==> Setting up container kontor-javalin"
if podman image exists localhost/kontor-javalin:$kontorVersion; then
echo " => Image localhost/kontor-javalin:$kontorVersion available"
fi
if podman container exists kontor-javalin; then
if podman ps -q --filter "name=kontor-javalin"; then
echo " => kontor-javalin is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-javalin \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-javalin.service" \
--health-cmd='curl -f http://kontor-echo:8600/health || exit 1' \
--health-interval=1s \
--health-timeout=5s \
--health-retries=10 \
localhost/kontor-javalin:$kontorVersion
fi
echo "==> Setting up container kontor-vue"
if podman image exists localhost/kontor-vue:$kontorVersion; then
echo " => Image localhost/kontor-vue:$kontorVersion available"
fi
if podman container exists kontor-vue; then
if podman ps -q --filter "name=kontor-vue"; then
echo " => kontor-vue is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-vue \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-vue.service" \
localhost/kontor-vue:$kontorVersion
fi
echo "==> Setting up container kontor-angular"
if podman image exists localhost/kontor-angular:$kontorVersion; then
echo " => Image localhost/kontor-angular:$kontorVersion available"
fi
if podman container exists kontor-angular; then
if podman ps -q --filter "name=kontor-angular"; then
echo " => kontor-angular is running"
fi
else
podman run -d \
--replace \
--pod kontor \
--name kontor-angular \
--label "io.containers.autoupdate=local" \
--label "PODMAN_SYSTEMD_UNIT=container-kontor-angular.service" \
localhost/kontor-angular:$kontorVersion
fi
script/create_container_kontor-angular
+2
View File
@@ -11,6 +11,8 @@ source version
echo "==> Stopping and removing pod kontor"
if podman pod exists kontor; then
podman pod stop kontor
pause 3
podman pod rm kontor
fi
#script/cibuild