-
Notifications
You must be signed in to change notification settings - Fork 969
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add launch config for VSCode (#3239)
- Loading branch information
1 parent
6fe4dac
commit a046778
Showing
7 changed files
with
187 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
// Launch configuration to build and launch Kratos | ||
// It uses a barebones | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug Kratos", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "debug", | ||
"program": "${workspaceFolder}/main.go", | ||
"buildFlags": "-tags sqlite", | ||
"preLaunchTask": "Kratos: setup", | ||
"postDebugTask": "close tasks", // stops mailhog. Needed, because VSCode does not re-use existing isBackground tasks | ||
"args": [ | ||
"serve", | ||
"--dev", | ||
"--watch-courier", | ||
"-c=${workspaceFolder}/contrib/quickstart/kratos/email-password/kratos.yml" | ||
], | ||
"internalConsoleOptions": "openOnSessionStart", | ||
"env": { | ||
"IDENTITY_SCHEMAS_0_URL": "file://${workspaceFolder}/contrib/quickstart/kratos/email-password/identity.schema.json", | ||
"DSN": "sqlite://${workspaceFolder}/.debug.sqlite.db?_fk=true", | ||
"COURIER_SMTP_CONNECTION_URI": "smtp://localhost:8026/?disable_starttls=true", | ||
"DEV_DISABLE_API_FLOW_ENFORCEMENT": "true", | ||
"SELFSERVICE_METHODS_PASSWORD_CONFIG_HAVEIBEENPWNED_ENABLED": "false", // disable locally, as the integration hangs requests, if internet is slow | ||
"TRACING_PROVIDER": "jaeger", | ||
"TRACING_PROVIDERS_JAEGER_SAMPLING_SERVER_URL": "http://127.0.0.1:5778/sampling", | ||
"TRACING_PROVIDERS_JAEGER_LOCAL_AGENT_ADDRESS": "127.0.0.1:6831" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Kratos: build", | ||
"type": "shell", | ||
"command": "go", | ||
"args": [ | ||
"build", | ||
"-tags", | ||
"sqlite", | ||
"-o", | ||
"${workspaceFolder}/kratos", | ||
"${workspaceFolder}/main.go" | ||
] | ||
}, | ||
{ | ||
"label": "Kratos debug: setup sqlite", | ||
"type": "shell", | ||
"presentation": { | ||
"echo": false, | ||
"reveal": "always" | ||
}, | ||
"dependsOn": ["Kratos: build"], | ||
"command": "rm -f ${workspaceFolder}/.debug.sqlite.db && ${workspaceFolder}/kratos migrate sql up -e --yes", | ||
"options": { | ||
"env": { | ||
"DSN": "sqlite://${workspaceFolder}/.debug.sqlite.db?_fk=true" | ||
} | ||
} | ||
}, | ||
{ | ||
"label": "Kratos: install mailhog", | ||
"type": "shell", | ||
"command": "make .bin/MailHog" | ||
}, | ||
{ | ||
"label": "Kratos: start mailhog", | ||
"type": "shell", | ||
"presentation": { | ||
"echo": false, | ||
"reveal": "always", | ||
"panel": "dedicated" | ||
}, | ||
"dependsOn": ["Kratos: install mailhog"], | ||
"isBackground": true, | ||
"command": "${workspaceFolder}/.bin/MailHog -smtp-bind-addr=localhost:8026", | ||
"problemMatcher": { | ||
"pattern": { | ||
"regexp": "" | ||
}, | ||
"background": { | ||
"activeOnStart": true, | ||
"beginsPattern": " ", | ||
"endsPattern": "Serving under" | ||
} | ||
} | ||
}, | ||
{ | ||
"label": "Kratos: setup", | ||
"type": "shell", | ||
"presentation": { | ||
"reveal": "silent" | ||
}, | ||
"dependsOn": ["Kratos: start mailhog", "Kratos debug: setup sqlite"], | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "close tasks", | ||
"command": "echo ${input:terminate}", | ||
"type": "shell", | ||
"problemMatcher": [] | ||
} | ||
], | ||
"inputs": [ | ||
{ | ||
"id": "terminate", | ||
"type": "command", | ||
"command": "workbench.action.tasks.terminate", | ||
"args": "terminateAll" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.