Skip to content

Commit

Permalink
Change PORT variable value to multi process
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusdeMelo committed Jan 26, 2024
1 parent 6423f69 commit c51ddb2
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,14 @@ if [ -z "$deploy_service_name" ]; then
fi

release_arn=$(cat .releasearn)
PORT=3000
if [[ $deploy_process_type != "scheduledtasks" && ( -z "$ECS_SERVICE_TASK_PROCESSES" || $ECS_SERVICE_TASK_PROCESSES =~ $deploy_process_type ) ]]; then
if [[ $deploy_process_type = "web" || $deploy_process_type =~ ^web[1-9] ]]; then
provision_target_group_arn=$(cat .tgarn)
if [[ $deploy_process_type =~ ^web[1-9] ]]; then
IFS='-' read -r -a branch <<< "$deploy_repository_slug"
PORT=$(aws secretsmanager get-secret-value --secret-id "${branch[1]}"/$deploy_repository_slug | jq --raw-output '.SecretString' | jq -r .PORT${deploy_process_type^^} || echo false)
fi
fi

deploy_desired_count=1
Expand All @@ -81,16 +86,6 @@ if [[ $deploy_process_type != "scheduledtasks" && ( -z "$ECS_SERVICE_TASK_PROCES
deploy_autoscaling_policies=${BASH_REMATCH[3]}
fi

if [ -z "$PORT" ]; then
# TODO: remember to load it from SM
PORT=3000
if [[ $deploy_process_type =~ ^web[1-9] ]]; then
IFS='-' read -r -a branch <<< "$deploy_repository_slug"
PORT=$(aws secretsmanager get-secret-value --secret-id "${branch[1]}"/$deploy_repository_slug | jq --raw-output '.SecretString' | jq -r .PORT${deploy_process_type^^} || echo false)
fi
echo "----> This is the PORT: $PORT"
fi

if [ -z "$DEPLOYMENT_CIRCUIT_BREAKER_RULE" ]; then
DEPLOYMENT_CIRCUIT_BREAKER_RULE='enable=true,rollback=true'
fi
Expand Down

0 comments on commit c51ddb2

Please sign in to comment.