Skip to main content

Diagnose Job Execution with Web Terminal

Sometimes, when a job is running, things don’t go as you would expect, and it would be helpful if one can have a shell to aid debugging. This tutorial demonstrates how to achieve it with pause command and web terminal introduced since 9.0

Request a Trial Subscription

Web terminal requires a subscription to use. Switch to menu item Administration / Subscription Management, request a trial subscription key and install it into OneDev if you do not have an active subscription:

request trial subscription

Open Web Terminal for Running Job

Now when a job starts, users with permission to edit build spec of running job will be able to open the interactive shell to check the live environment. This works for all executor types. The permission to edit build spec is required as web shell also allows to change behavior of runningn job

open shell

Add Pause Instruction to Command Step

Often you need to pause execution of the job so that you can easily check live environment at particular point. For CI jobs executing command step, you can do so by inserting pause instruction like below:

echo "before pause"
echo "after pause"

Run the job and the step will pause at the desired point:

pause execution

After finishing analyzing, you may resume the job by clicking the resume link, or just cancel the job if you do not want it to execute anymore.