Skip to content

update the debugging process #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env-sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
WEBHOOK_PROXY_URL=
APP_ID=
WEBHOOK_SECRET=
PRIVATE_KEY=
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ node_modules

# aws sam stuff
.aws-sam
samconfig.toml
samconfig.toml
vars.json
.env
28 changes: 6 additions & 22 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,12 @@
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to lambda",
"address": "localhost",
"port": 9999,
"localRoot": "${workspaceRoot}",
"remoteRoot": "/var/task",
"protocol": "inspector",
"stopOnEntry": false
},
{
"type": "aws-sam",
"request": "direct-invoke",
"name": "webhooks",
"invokeTarget": {
"target": "template",
"templatePath": "${workspaceFolder}/template.yaml",
"logicalId": "webhooks"
},
"lambda": {
"payload": {},
"environmentVariables": {}
}
"request": "launch",
"name": "Launch Probot",
"runtimeExecutable": "probot",
"runtimeArgs": ["run", "./app.js"],
"console": "integratedTerminal",
"cwd": "${workspaceRoot}/",
}
]
}
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ Subsequent deploys to the same stack to the default environment...
1. run `sam deploy`

## Debugging locally
1. Populate the values in vars.json with the ones specific for your GitHub app. For the `PRIVATE_KEY` replace newlines with `\\n` to make the string value a single line.
1. run `sam build`
1. Run sam local via bash...
```
sam local invoke -d 9999 webhooks -n vars.json -e events/event.json
```
1. Point your GitHub app to your local using something like smee.io
1. Copy .env-sample to .env and populate with values specific for your GitHub app. For the `PRIVATE_KEY` replace newlines with `\\n` to make the string value a single line.
1. From the VSCode `RUN AND DEBUG` menu select `Launch Probot` and click the green arrow to start debugging.

## License

[ISC](LICENSE)
190 changes: 0 additions & 190 deletions events/body.json

This file was deleted.

Loading