-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) Β· 1.74 KB
/
Copy pathec2-reboot.yml
File metadata and controls
53 lines (45 loc) Β· 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: EC2-READ-DEPLOY-LOG
on:
workflow_dispatch:
jobs:
read-log:
name: Read CodeDeploy Logs
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_PROD_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_PROD_SECRET_KEY }}
aws-region: ap-northeast-2
- name: Get deployment lifecycle events
run: |
echo "=== μ΅κ·Ό λ°°ν¬ λͺ©λ‘ (μ΅λ 5κ°) ==="
DEPLOYMENTS=$(aws deploy list-deployments \
--application-name runnect-prod-codedeploy \
--deployment-group-name runnect-prod-codedeploy-group \
--query "deployments[:5]" \
--output text 2>/dev/null)
echo "Deployments: $DEPLOYMENTS"
for DEP_ID in $DEPLOYMENTS; do
echo ""
echo "================================================"
echo "=== Deployment: $DEP_ID ==="
echo "================================================"
aws deploy get-deployment --deployment-id "$DEP_ID" \
--query "deploymentInfo.{status:status, createTime:createTime, completeTime:completeTime, error:errorInformation}" \
--output json 2>&1
echo ""
echo "--- Instance lifecycle events ---"
INSTANCES=$(aws deploy list-deployment-instances \
--deployment-id "$DEP_ID" \
--query "instancesList" \
--output text 2>/dev/null)
for INST in $INSTANCES; do
echo "Instance: $INST"
aws deploy get-deployment-instance \
--deployment-id "$DEP_ID" \
--instance-id "$INST" \
--output json 2>&1
done
done