Is there any environment variable available for getting the Jenkins Pipeline Title?
I know we can use $JOB_NAME
to get title for a freestyle job,
but is th
To avoid problems of side effects after changing env
, especially using multiple nodes, it is better to set a temporary context.
One safe way to alter the environment is:
withEnv(['MYTOOL_HOME=/usr/local/mytool']) {
sh '$MYTOOL_HOME/bin/start'
}
This approach does not poison the env after the command execution.