Skip to content

Commit e38036c

Browse files
authored
Update docs to include information about debugging (#4852)
Co-authored-by: Grzegorz Gurgul <[email protected]>
1 parent 3f88445 commit e38036c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/contribute.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,25 @@ cd ./src
3030
./dev.(sh/cmd) test # run unit tests before git commit/push
3131
```
3232

33+
## Debugging
34+
35+
The agent can be run in debug mode by providing the parameter `--debug` to the `run` command.
36+
This will make the agent recognize the following environment variables:
37+
38+
- `VSTSAGENT_DEBUG_TASK` - for remote debugging node-based pipeline tasks
39+
40+
Note that all of these variables need to be defined on the node that is used to run the agent.
41+
Also, do not run production agents with this mode as it can cause pipelines to appear stuck.
42+
43+
### `VSTSAGENT_DEBUG_TASK` environment variable
44+
45+
When enabled, the agent will start the Node process with specific parameters. These parameters cause the process to wait for the debugger to attach before continuing with the execution of the pipeline task script. The value must be set to either:
46+
- Task `id`, which is an unique GUID identifier to be found in `task.json` definition of the task
47+
- Task `name` and major `version`, e.g. AzureCLIV2
48+
49+
Only one task can be debugged at one time and all other tasks in the same pipeline will proceed as usual.
50+
If you wish to stop debugging this task either restart that agent without `--debug` option, or unset the variables from above.
51+
3352
## Editors
3453

3554
[Using Visual Studio 2017](https://www.visualstudio.com/vs/)

0 commit comments

Comments
 (0)