Interview Prep/Jenkins/Declarative pipeline syntax

What are the common built-in environment variables in a pipeline?

BeginnerConceptDeclarative pipeline syntax
Answer

BUILD_NUMBER, BUILD_ID, BUILD_URL, JOB_NAME, JOB_BASE_NAME, WORKSPACE, NODE_NAME, EXECUTOR_NUMBER, JENKINS_URL. In multibranch: BRANCH_NAME, CHANGE_ID, CHANGE_TARGET, CHANGE_BRANCH, CHANGE_AUTHOR, TAG_NAME. From the Git plugin after checkout: GIT_COMMIT, GIT_BRANCH, GIT_URL, GIT_PREVIOUS_SUCCESSFUL_COMMIT. The full list is at ${JENKINS_URL}pipeline-syntax/globals.

All Jenkins questions Roadmap: Jenkins

More on Declarative pipeline syntax