How to list all `env` properties within jenkins pipeline job?
Given a jenkins 2.1 build pipeline, jenkins injects a env variable into the node{} . For example, BRANCH_NAME can be accessed with node { echo ${env.BRANCH_NAME} ... I want to echo all env properties within the jenkins pipeline. I'm looking for code like node { for(e in env){ echo e + " is " + ${e} } ... which would echo something like BRANCH_NAME is myBranch2 CHANGE_ID is 44 ... Another, more concise way: node { echo sh(returnStdout: true, script: 'env') // ... } cf. https://jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#code-sh-code-shell-script According to Jenkins documentation