Skip to content

Commit

Permalink
Change loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
everaldorodrigo committed Nov 29, 2023
1 parent 4eada85 commit c398e39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Fetch EC2 instances from Auto Scaling Group
run: |
INSTANCE_IDS=$(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names $AWS_AUTO_SCALING_GROUP_NAME --query "AutoScalingGroups[0].Instances[*].InstanceId" --output json)
INSTANCE_ID_STRING=$(echo $INSTANCE_IDS | jq -r '. | join(" ")')
# INSTANCE_ID_STRING=$(echo $INSTANCE_IDS | jq -r '. | join(" ")')
# echo "Fetched instances from Auto Scaling Group: $INSTANCE_ID_STRING"
- name: Open SSH port to GitHub Actions IP
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Deploy to EC2
run: |
# Extract the instance IDs using jq (JSON processor)
IFS=$'\n' read -d '' -r -a INSTANCES <<< "$(echo "$INSTANCE_ID_STRING" | jq -r '.[]')"
IFS=$'\n' read -d '' -r -a INSTANCES <<< "$(echo "$INSTANCE_IDS" | jq -r '.[]')"
# Iterate over the array
for INSTANCE_ID in "${INSTANCES[@]}"; do
Expand Down

0 comments on commit c398e39

Please sign in to comment.