Can a script that may be run by Buildbot's ShellCommand detect whether it is indeed running inside the context of Buildbot (e.g. as opposed to having been started manually in a shell)?
For instance, does Buildbot set any environment variables (such as GitLab's CI_JOB_STAGE that the script could inspect?
I am looking for a well-portable solution, so setting a proprietary environment variable e.g. at the level of some Buildbot builders or inspecting the script's parent process is not quite what I am looking for.
At least, it can detect if it is in an interactive session (when launched manually) vs. launched non-interactively (from a script or, in this instance, buildbox builder).
In a bash session,
$-would display the current options set for the shell.Change you job to include a call to your script with:
In your script: