File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 35
35
--output text \
36
36
--query 'pipelineExecutionId')
37
37
./.github/workflows/monitor_pipelines.sh $PIPELINE_EXEC_ID
38
+
39
+ - name : Check Pipeline Status
40
+ run : |
41
+ while true; do
42
+ # Check if the stack exists and get its status
43
+ STACK_STATUS=$(aws cloudformation describe-stacks \
44
+ --stack-name "Observability-Workshop" \
45
+ --query 'Stacks[0].StackStatus' \
46
+ --output text 2>/dev/null || echo "STACK_NOT_FOUND")
47
+
48
+ if [ "$STACK_STATUS" == "STACK_NOT_FOUND" ]; then
49
+ echo "Stack 'Observability-Workshop' not found yet. Waiting..."
50
+ else
51
+ echo "Stack 'Observability-Workshop' status: $STACK_STATUS"
52
+
53
+ # Check if the stack is in a completed state
54
+ if [[ "$STACK_STATUS" == *"COMPLETE"* ]]; then
55
+ if [[ "$STACK_STATUS" == "CREATE_COMPLETE" || "$STACK_STATUS" == "UPDATE_COMPLETE" ]]; then
56
+ echo "Stack deployment succeeded!"
57
+ exit 0
58
+ else
59
+ echo "Stack deployment failed with status: $STACK_STATUS"
60
+ exit 1
61
+ fi
62
+ elif [[ "$STACK_STATUS" == *"FAILED"* || "$STACK_STATUS" == *"ROLLBACK"* ]]; then
63
+ echo "Stack deployment failed with status: $STACK_STATUS"
64
+ exit 1
65
+ fi
66
+ fi
67
+
68
+ echo "Waiting for stack deployment to complete..."
69
+ sleep 30
70
+ done
You can’t perform that action at this time.
0 commit comments