From 025849289cf374549be162b780c2a71706f2a3e4 Mon Sep 17 00:00:00 2001 From: Nicholas Moen Date: Fri, 6 Oct 2023 07:30:18 -0600 Subject: [PATCH] fix: replace remaining instances of 'deployment_type' and 'server_environment' --- .../compose--phoenix-postgres-traefik | 4 ++-- .../systemd-container-service-file-generate | 18 +++++++++--------- .../scripts/systemd-native-service-generate | 3 --- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/support/scripts/containers/compose--phoenix-postgres-traefik b/support/scripts/containers/compose--phoenix-postgres-traefik index 00a3507..da49196 100755 --- a/support/scripts/containers/compose--phoenix-postgres-traefik +++ b/support/scripts/containers/compose--phoenix-postgres-traefik @@ -40,7 +40,7 @@ if [ "$1" = "" ] || [ "$1" != "dev" ] && [ "$1" != "staging" ] && [ "$1" != "sta printf "\033[31mThe second positional argument must be one of: dev, staging, prod\033[39m\nAborting...\n" exit 1 else - deployment_type=$1 + deployment_environment=$1 # shift first positional argument out of args shift @@ -71,4 +71,4 @@ fi # run container action # shellcheck disable=SC2068,SC2086 -$application_to_run -f compose.phoenix.yaml -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-$deployment_type.yaml -f compose.postgres.yaml -f compose.traefik.yaml -f compose.traefik-config-$deployment_type.yaml $action $@ +$application_to_run -f compose.phoenix.yaml -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-$deployment_environment.yaml -f compose.postgres.yaml -f compose.traefik.yaml -f compose.traefik-config-$deployment_environment.yaml $action $@ diff --git a/support/scripts/systemd-container-service-file-generate b/support/scripts/systemd-container-service-file-generate index edd3b3e..c9ffb5e 100755 --- a/support/scripts/systemd-container-service-file-generate +++ b/support/scripts/systemd-container-service-file-generate @@ -130,18 +130,18 @@ else use_docker=1 # use docker-specific options in the systemd service file fi -# set deployment_type (based on DEPLOYMENT_TYPE env var, or relevant flags) +# set deployment_environment (based on DEPLOYMENT_TYPE env var, or relevant flags) # shellcheck disable=SC2153 -deployment_type="$DEPLOYMENT_TYPE" # use global env var by default +deployment_environment="$DEPLOYMENT_ENVIRONMENT" # use global env var by default if [ "$is_dev" = 1 ]; then - deployment_type="dev" + deployment_environment="dev" elif [ "$is_staging" = 1 ]; then - deployment_type="staging" + deployment_environment="staging" elif [ "$is_prod" = 1 ]; then - deployment_type="prod" -elif [ "$deployment_type" = "" ]; then + deployment_environment="prod" +elif [ "$deployment_environment" = "" ]; then printf "\033[96mNo deployment type specified. Using 'dev' (no HTTPS)...\033[39m\n" - deployment_type="dev" + deployment_environment="dev" fi # containers_to_run # @@ -149,7 +149,7 @@ fi containers_to_run="-f compose.phoenix.yaml" if [ "$use_traefik_client" = 1 ] || [ "$use_traefik_host" = 1 ]; then - containers_to_run="$containers_to_run -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-${deployment_type}.yaml" + containers_to_run="$containers_to_run -f networks/compose.phoenix-traefik.yaml -f compose.phoenix-config-traefik-${deployment_environment}.yaml" else containers_to_run="$containers_to_run -f networks/compose.phoenix-host.yaml" fi @@ -167,7 +167,7 @@ fi # traefik if [ "$use_traefik_host" ]; then # run traefik container - containers_to_run="$containers_to_run -f compose.traefik.yaml -f compose.traefik-config-${deployment_type}.yaml" + containers_to_run="$containers_to_run -f compose.traefik.yaml -f compose.traefik-config-${deployment_environment}.yaml" fi # for dry_run, print output to terminal instead of writing to a file diff --git a/support/scripts/systemd-native-service-generate b/support/scripts/systemd-native-service-generate index 6c681cf..f345c4e 100755 --- a/support/scripts/systemd-native-service-generate +++ b/support/scripts/systemd-native-service-generate @@ -11,9 +11,6 @@ The output will be sent here: '$service_file' In order to start this service on boot, you must enabling lingering for this user: - sudo loginctl enable-linger $USER -Environment variables: - - SERVER_ENVIRONMENT: Must be one of: dev, test, prod - To enable this service: - systemctl --user enable $service_name.service