Skip to content

Commit

Permalink
compare
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirko-von-Leipzig committed Aug 29, 2024
1 parent 3e3caf1 commit 62e4202
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/actions/ssm-send-command/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,35 @@ runs:
--query "Command.CommandId")
echo "command-id=$COMMAND_ID" >> $GITHUB_OUTPUT
- name: Check stop services command status and retrieve output
shell: bash
run: |
while true; do
STATUS=$(aws ssm list-command-invocations \
--command-id ${{ steps.run-command.outputs.command-id }} \
--details \
--query "CommandInvocations[0].Status" \
--output text)
echo "Command Status: $STATUS"
OUTPUT=$(aws ssm list-command-invocations \
--command-id ${{ steps.run-command.outputs.command-id }} \
--details \
--query "CommandInvocations[0].CommandPlugins[0].Output" \
--output text)
echo "Command Output: $OUTPUT"
if [ "$STATUS" == "Success" ]; then
echo "Command completed successfully."
break
elif [ "$STATUS" == "Failed" ] || [ "$STATUS" == "Cancelled" ]; then
echo "Command failed with status: $STATUS"
exit 1
else
sleep 10 # Wait for 30 seconds before checking again
fi
done
- name: Wait for command completion
shell: bash
id: poll-status
Expand All @@ -37,6 +66,8 @@ runs:
--query "CommandInvocations[0].Status" \
--output text)
echo "status is $STATUS"
# Print a progress `.` token until the command completes.
case $STATUS in
Pending | InProgress | Delayed )
Expand Down

0 comments on commit 62e4202

Please sign in to comment.