From 467d24daeea0c852e003ec9cb4c748fc1b44fddc Mon Sep 17 00:00:00 2001 From: Gabriel Roldan Date: Fri, 7 Jan 2022 00:32:34 -0300 Subject: [PATCH] Add simple podman shell scripts for manual test run --- .../podman/traditional/manual/.gitignore | 1 + docs/deploy/podman/traditional/manual/config | 1 + docs/deploy/podman/traditional/manual/env | 2 + .../podman/traditional/manual/podman.md | 4 +- docs/deploy/podman/traditional/manual/pull.sh | 11 ++++ .../podman/traditional/manual/shutdown.sh | 7 +++ .../podman/traditional/manual/startup.sh | 56 +++++++++++++++++++ 7 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 docs/deploy/podman/traditional/manual/.gitignore create mode 120000 docs/deploy/podman/traditional/manual/config create mode 100644 docs/deploy/podman/traditional/manual/env create mode 100755 docs/deploy/podman/traditional/manual/pull.sh create mode 100755 docs/deploy/podman/traditional/manual/shutdown.sh create mode 100755 docs/deploy/podman/traditional/manual/startup.sh diff --git a/docs/deploy/podman/traditional/manual/.gitignore b/docs/deploy/podman/traditional/manual/.gitignore new file mode 100644 index 000000000..d64a52ece --- /dev/null +++ b/docs/deploy/podman/traditional/manual/.gitignore @@ -0,0 +1 @@ +datadir diff --git a/docs/deploy/podman/traditional/manual/config b/docs/deploy/podman/traditional/manual/config new file mode 120000 index 000000000..a61e19e96 --- /dev/null +++ b/docs/deploy/podman/traditional/manual/config @@ -0,0 +1 @@ +../../../../../config \ No newline at end of file diff --git a/docs/deploy/podman/traditional/manual/env b/docs/deploy/podman/traditional/manual/env new file mode 100644 index 000000000..ee571a19d --- /dev/null +++ b/docs/deploy/podman/traditional/manual/env @@ -0,0 +1,2 @@ +GSCLOUD_VERSION=1.0-RC7 + diff --git a/docs/deploy/podman/traditional/manual/podman.md b/docs/deploy/podman/traditional/manual/podman.md index 53c4b3a2c..a488fe928 100644 --- a/docs/deploy/podman/traditional/manual/podman.md +++ b/docs/deploy/podman/traditional/manual/podman.md @@ -28,7 +28,7 @@ In order to speed up the "starting" part of the documentation we are going to do ```bash podman pull docker.io/library/rabbitmq:3.9-management -export GSCLOUD_VERSION=1.0-RC6 +export GSCLOUD_VERSION=1.0-RC7 for service in discovery config gateway admin-server rest webui wms wfs wcs do @@ -71,7 +71,7 @@ podman run -d --name=config --hostname=config \ --network gs-cloud-network \ -e SPRING_PROFILES_ACTIVE=git \ -e CONFIG_GIT_URI=https://github.com/geoserver/geoserver-cloud-config.git \ - -e SPRING_CLOUD_CONFIG_SERVER_GIT_DEFAULT_LABEL=v1.0-RC6 \ + -e SPRING_CLOUD_CONFIG_SERVER_GIT_DEFAULT_LABEL=v1.0-RC7 \ -e CONFIG_GIT_BASEDIR=/opt/app/git_config \ geoservercloud/geoserver-cloud-config:$GSCLOUD_VERSION ``` diff --git a/docs/deploy/podman/traditional/manual/pull.sh b/docs/deploy/podman/traditional/manual/pull.sh new file mode 100755 index 000000000..569e5e415 --- /dev/null +++ b/docs/deploy/podman/traditional/manual/pull.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# read GSCLOUD_VERSION from ./env +export $(cat ./env) + +podman pull docker.io/library/rabbitmq:3.9-management + +for i in discovery config gateway rest webui wms wfs wcs admin-server +do + podman pull docker-daemon:geoservercloud/geoserver-cloud-$i:$GSCLOUD_VERSION +done diff --git a/docs/deploy/podman/traditional/manual/shutdown.sh b/docs/deploy/podman/traditional/manual/shutdown.sh new file mode 100755 index 000000000..0ca05271e --- /dev/null +++ b/docs/deploy/podman/traditional/manual/shutdown.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +for service in gateway rest webui wms wfs wcs admin-server discovery config rabbitmq +do + podman container stop -i $service + podman container rm -i $service +done diff --git a/docs/deploy/podman/traditional/manual/startup.sh b/docs/deploy/podman/traditional/manual/startup.sh new file mode 100755 index 000000000..8d981c0e3 --- /dev/null +++ b/docs/deploy/podman/traditional/manual/startup.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +podman network create gscloud 2>/dev/null + +podman volume create rabbitmq_data 2>/dev/null + +# read GSCLOUD_VERSION from ./env +export $(cat ./env) + +STD_OPTS="-d --network gscloud" + +# Note rabbitmq and discovery are the only containers addressed +# by hostname inside the cluster, so we're adding the --hostname +# parameter to `podman run` on them. All other container urls are +# resolved by discovery. + +echo Starting rabbitmq... +podman run $STD_OPTS --name=rabbitmq --hostname=rabbitmq \ + -v rabbitmq_data:/var/lib/rabbitmq \ + --restart always \ + rabbitmq:3.9-management + +echo Starting discovery:$GSCLOUD_VERSION... +podman run $STD_OPTS --name=discovery --hostname=discovery \ + -p 8761:8761 \ + --restart always \ + geoservercloud/geoserver-cloud-discovery:$GSCLOUD_VERSION + +echo Starting config:$GSCLOUD_VERSION... +podman run $STD_OPTS --name=config \ + --restart always \ + -e SPRING_PROFILES_ACTIVE=native \ + -v ./config:/opt/app/config:z \ + -e CONFIG_NATIVE_PATH=/opt/app/config \ + geoservercloud/geoserver-cloud-config:$GSCLOUD_VERSION + +echo Starting gateway:$GSCLOUD_VERSION... +podman run $STD_OPTS --name=gateway \ + -p 9090:8080 \ + geoservercloud/geoserver-cloud-gateway:$GSCLOUD_VERSION + +echo Starting admin-server:$GSCLOUD_VERSION... +podman run $STD_OPTS --name=admin-server \ + -p 9091:8080 \ + geoservercloud/geoserver-cloud-admin-server:$GSCLOUD_VERSION + +mkdir -p datadir +#for i in webui wms wfs wcs rest +for i in webui wms wfs +do + echo Starting $i:$GSCLOUD_VERSION... + podman run $STD_OPTS --name=$i \ + -e SPRING_PROFILES_ACTIVE=datadir \ + -v ./datadir:/opt/app/data_directory:z \ + geoservercloud/geoserver-cloud-$i:$GSCLOUD_VERSION +done