This is a special step that allows to run checkouts using any configuration options offered by any Pipeline-compatible SCM plugin. To use a concrete SCM implementations, just install the corresponding plugin and check if it is shown in the list below. Then select the SCM to use from the dropdown list and configure it as needed.
This step returns a Map
of any variables the SCM plugin would
set in a Freestyle job, so if your SCM is git, you can do:
def scmVars = checkout scm def commitHash = scmVars.GIT_COMMIT // or def commitHash = checkout(scm).GIT_COMMIT
Any other specific step to run checkouts (like svn
or git
)
are simplistic options of this step.