Skip to content

Commit

Permalink
fix: replace remaining instances of 'deployment_type' and 'server_env…
Browse files Browse the repository at this point in the history
…ironment'
  • Loading branch information
arcanemachine committed Oct 6, 2023
1 parent 0c8a7f4 commit 0258492
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions support/scripts/containers/compose--phoenix-postgres-traefik
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 $@
18 changes: 9 additions & 9 deletions support/scripts/systemd-container-service-file-generate
Original file line number Diff line number Diff line change
Expand Up @@ -130,26 +130,26 @@ 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 #
# phoenix
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
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions support/scripts/systemd-native-service-generate
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0258492

Please sign in to comment.