-
Notifications
You must be signed in to change notification settings - Fork 68
/
help.jelly
35 lines (33 loc) · 1.34 KB
/
help.jelly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?xml version="1.0" encoding="UTF-8"?>
<?jelly escape-by-default='true'?>
<div xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<p>
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.
</p>
<p>This step returns a <code>Map</code> of any variables the SCM plugin would
set in a Freestyle job, so if your SCM is git, you can do:
</p>
<pre>
def scmVars = checkout scm
def commitHash = scmVars.GIT_COMMIT
// or
def commitHash = checkout(scm).GIT_COMMIT
</pre>
<p>
Specific variables advertised by installed plugins:
</p>
<!-- Cf. EnvironmentContributor/EnvVarsHtml/index.groovy -->
<dl class="env-vars">
<j:forEach var="d" items="${app.getDescriptor('org.jenkinsci.plugins.workflow.steps.scm.GenericSCMStep').applicableDescriptors}">
<st:include class="${d.clazz}" page="buildEnv" optional="true"/>
</j:forEach>
</dl>
<p>
Any other specific step to run checkouts (like <code>svn</code> or <code>git</code>)
are simplistic options of this step.
</p>
</div>