From a4f9f3e2ab8682cfb6c7593b7de31a242088a78e Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Thu, 8 Feb 2024 23:43:24 -0500 Subject: [PATCH] refactor(scripts): clean up references to networks --- Taskfile.yml | 4 ++++ services/bastion/constants.sh | 1 - services/bastion/start.sh | 4 +--- services/bitwarden/constants.sh | 1 - services/bookstack/constants.sh | 1 - services/deluge/constants.sh | 1 - services/deluge/start.sh | 2 ++ 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 678a709..bbdf391 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -17,6 +17,9 @@ vars: sh: git describe --tags --exact-match $(git rev-parse HEAD) 2> /dev/null || echo "dev-$(git rev-parse HEAD)" tasks: + ensure-pod: + desc: "Creates the pod if it doesn't already exist." + cmd: . ./pod.sh build: desc: "Builds images for one or more services. Include service names as a space-separated list." cmds: @@ -28,6 +31,7 @@ tasks: prefix: "build: {{ .CLI_ARGS }}" dir: services start: + deps: [ensure-pod] desc: "Starts one or more services. Include service names as a space-separated list." cmds: - for: { var: CLI_ARGS } diff --git a/services/bastion/constants.sh b/services/bastion/constants.sh index 6a11f1c..abae0df 100644 --- a/services/bastion/constants.sh +++ b/services/bastion/constants.sh @@ -3,4 +3,3 @@ export APP_NAME="bastion" export APP_CONTAINER_NAME=$APP_NAME-app export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME -export NETWORK_NAME=$APP_NAME-local diff --git a/services/bastion/start.sh b/services/bastion/start.sh index 597d978..cb034e5 100644 --- a/services/bastion/start.sh +++ b/services/bastion/start.sh @@ -2,11 +2,9 @@ source constants.sh -podman network create $NETWORK_NAME || echo "Network $NETWORK_NAME already exists" - podman run \ --detach \ - --network $NETWORK_NAME \ + --pod services \ --name $APP_CONTAINER_NAME \ --env-file $ENV_FILE_DIR/bastion.env \ $APP_IMAGE_NAME:$IMAGE_VERSION diff --git a/services/bitwarden/constants.sh b/services/bitwarden/constants.sh index 2df6d9c..ba3d16e 100644 --- a/services/bitwarden/constants.sh +++ b/services/bitwarden/constants.sh @@ -5,4 +5,3 @@ export APP_CONTAINER_NAME=$APP_NAME-app export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME export DB_CONTAINER_NAME=$APP_NAME-db export DB_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$DB_CONTAINER_NAME -export NETWORK_NAME=$APP_NAME-local diff --git a/services/bookstack/constants.sh b/services/bookstack/constants.sh index 8c68636..01376f9 100644 --- a/services/bookstack/constants.sh +++ b/services/bookstack/constants.sh @@ -5,4 +5,3 @@ export APP_CONTAINER_NAME=$APP_NAME-app export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME export DB_CONTAINER_NAME=$APP_NAME-db export DB_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$DB_CONTAINER_NAME -export NETWORK_NAME=$APP_NAME-local diff --git a/services/deluge/constants.sh b/services/deluge/constants.sh index e68981f..834c9b0 100644 --- a/services/deluge/constants.sh +++ b/services/deluge/constants.sh @@ -3,4 +3,3 @@ export APP_NAME="deluge" export APP_CONTAINER_NAME=$APP_NAME-app export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME -export NETWORK_NAME=$APP_NAME-local diff --git a/services/deluge/start.sh b/services/deluge/start.sh index 92408e2..6b834a6 100644 --- a/services/deluge/start.sh +++ b/services/deluge/start.sh @@ -5,6 +5,8 @@ source constants.sh podman run \ --detach \ --pod services \ + -e PGUID=1000 \ + -e PGID=1000 \ --name $APP_CONTAINER_NAME \ --env-file $ENV_FILE_DIR/deluge.env \ --mount type=bind,source=$APP_DATA_DIR/deluge/config,target=/config \