Skip to content

Commit 0fa06af

Browse files
committed
extra steps to report failure and show logs
1 parent d5003c3 commit 0fa06af

10 files changed

Lines changed: 3374 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,34 @@ jobs:
5656
- name: Run tests
5757
run: |
5858
make test
59+
60+
- name: Show localstack logs
61+
if: always()
62+
run: |
63+
make logs
64+
cat logs.txt
65+
66+
- name: Send a Slack notification
67+
if: failure() || github.event_name != 'pull_request'
68+
uses: ravsamhq/notify-slack-action@v2
69+
with:
70+
status: ${{ job.status }}
71+
token: ${{ secrets.GITHUB_TOKEN }}
72+
notification_title: "{workflow} has {status_message}"
73+
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
74+
footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Workflow run>"
75+
notify_when: "failure"
76+
env:
77+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
78+
79+
- name: Generate a Diagnostic Report
80+
if: failure()
81+
run: |
82+
curl -s localhost:4566/_localstack/diagnose | gzip -cf > diagnose.json.gz
83+
84+
- name: Upload the Diagnostic Report
85+
if: failure()
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: diagnose.json.gz
89+
path: ./diagnose.json.gz

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ volume/
33
cdk.out
44
dms_sample
55
__pycache__/
6+
cdk.local.out

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ deploy-aws: ## Deploy the stack on AWS
5757
$(VENV_RUN); $(CLOUD_ENV) cdk bootstrap
5858
$(VENV_RUN); $(CLOUD_ENV) cdk deploy --require-approval never
5959

60-
destroy: ## Destroy the stack on LocalStack
60+
stop: ## Stop LocalStack
6161
docker-compose down
6262

6363
destroy-aws: venv ## Destroy the stack on AWS
@@ -70,6 +70,6 @@ test-aws: ## Test the application on AWS
7070
$(VENV_RUN); $(CLOUD_ENV) python run.py
7171

7272
logs: ## Show logs from LocalStack
73-
@docker logs -f localstack_main > logs.txt
73+
@docker logs localstack-main > logs.txt
7474

75-
.PHONY: usage install start deploy test logs destroy deploy-aws test-aws destroy-aws
75+
.PHONY: usage install start deploy test logs stop deploy-aws test-aws destroy-aws
Binary file not shown.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"version": "36.0.0",
3+
"files": {
4+
"ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a": {
5+
"source": {
6+
"path": "asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a",
7+
"packaging": "zip"
8+
},
9+
"destinations": {
10+
"current_account-current_region": {
11+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12+
"objectKey": "ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a.zip",
13+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
14+
}
15+
}
16+
},
17+
"8b77ff306aac45b9565286a6ffbf146cbdf75d8b5a30e07daf8df71f6737718c": {
18+
"source": {
19+
"path": "DMsSampleSetupStack.template.json",
20+
"packaging": "file"
21+
},
22+
"destinations": {
23+
"current_account-current_region": {
24+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
25+
"objectKey": "8b77ff306aac45b9565286a6ffbf146cbdf75d8b5a30e07daf8df71f6737718c.json",
26+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
27+
}
28+
}
29+
}
30+
},
31+
"dockerImages": {}
32+
}

0 commit comments

Comments
 (0)