Skip to content
Permalink
Browse files
[JENKINS-49893] Declarative Directive Generator docs
  • Loading branch information
abayer committed Mar 28, 2018
1 parent e466098 commit 88f96773065accf950417856bdb7f18c3072ddb1
Showing with 29 additions and 0 deletions.
  1. +26 −0 content/doc/book/pipeline/getting-started.adoc
  2. +3 −0 content/doc/book/pipeline/syntax.adoc
@@ -325,6 +325,32 @@ link:http://localhost:8080/pipeline-syntax/globals#currentBuild[Global Variable
for a complete, and up to date, list of properties available on `currentBuild`.


[[directive-generator]]
=== Declarative Directive Generator

While the Snippet Generator can help with generating steps for a Scripted
Pipeline or for the `steps` block in a `stage` in a Declarative Pipeline, it
does not cover the link:../syntax#declarative-sections[sections] and
link:../syntax#declarative-directives[directives] used to define a Declarative Pipeline.
The "Declarative Directive Generator" utility can help with that. It allows you
to choose a Declarative directive, configure it in a form, and generate the
configuration for that directive to put in your Jenkinsfile, similar to the
Snippet Generator.

To generate a Declarative directive using the Declarative Directive Generator:

. Navigate to the *Pipeline Syntax* link (referenced above) from a configured Pipeline,
and then click on the *Declarative Directive Generator* link in the sidepanel,
or go directly to link:http://localhost:8080/directive-generator[localhost:8080/directive-generator].
. Select the desired directive in the dropdown menu
. Use the dynamically populated area below the dropdown to configure the selected directive.
. Click *Generate Directive* to create the directive's configuration to copy
into your Pipeline.

Note that directives which contain steps, such as `steps` within a `stage` or
conditions in `post` like `always` or `failure`, will only contain a comment,
and you will still need to add steps to the Pipeline by hand.

== Further Reading

This section merely scratches the surface of what can be done with Jenkins
@@ -66,6 +66,9 @@ with the following exceptions:
* A property reference statement is treated as no-argument method invocation. So for
example, input is treated as input()

You can use the link://../getting-started#directive-generator[Declarative Directive Generator]
to help you get started with configuring the directives and sections in your
Declarative Pipeline.

[[declarative-sections]]
=== Sections

0 comments on commit 88f9677

Please sign in to comment.