Jenkins : Pipeline Basic Steps Plugin

Plugin Information

View Pipeline: Basic Steps on the plugin site for more information.

Commonly used steps for Pipelines.

A component of Pipeline Plugin.

Changelog

2.18 (Jun 04, 2019)

You must update Pipeline Groovy Plugin to version 2.70 along with this update.

  • JENKINS-41854: Refresh references to files on agents when an agent reconnects. Fixes some cases where a dir step would fail with a RequestAbortedException due to a ChannelClosedException if the agent had disconnected earlier during the build even if the agent was connected to Jenkins at the time of failure.
  • JENKINS-57537: The buildResult  and stageResult  parameters added to the catchError step in version 2.16 of this plugin did not work correctly in a Declarative Pipeline.

2.17 (Jun 03, 2019)

  • Released incorrectly, do not use.

2.16 (May 14, 2019)

This plugin now requires Jenkins 2.138.4 or newer.

  • JENKINS-45579/JENKINS-39203: Use a new API provided by Pipeline API Plugin version 2.34 to create new steps to set the build result to UNSTABLE in a way that allows visualizations such as Blue Ocean to identify the stage and step that set the build result to UNSTABLE.
    • Note: In order for stage-related results to be visualized differently in Blue Ocean, you must update to Pipeline: Graph Analysis 1.10 or newer.
    • The catchError step has been updated with new optional parameters:
      • message: String -  A message that will be printed to the build log if an exception is caught. The message will be associated with the stage result if the stage result is set and may be shown in visualizations such as Blue Ocean in the future.
      • buildResult: String - What the overall build result should be set to if an exception is caught. Use null or SUCCESS to not set the build result. Defaults to FAILURE.
      • stageResult: String - What the stage result should be set to if an exception is caught. Use null or SUCCESS to not set the stage result. Defaults to SUCCESS.
      • catchInterruptions: boolean - If true, certain types of exceptions that are used to interrupt the flow of execution for Pipelines will be caught and handled by the step. If false, those types of exceptions will be caught and immediately rethrown. Examples of these types of exceptions include those thrown when a build is manually aborted through the UI and those thrown by the timeout step. Defaults to true.
    • The following two steps have been added:
      • unstable(message: String): Prints a message to the log and sets the overall build result and the stage result to UNSTABLE. The message will be associated with the stage result and may be shown in visualizations such as Blue Ocean in the future.
      • warnError(message: String, catchInterruptions: boolean): Executes its body, and if an exception is thrown, sets the overall build result and the stage result to UNSTABLE, prints the specified message and the exception to the build log, and associates the stage result with the message so that it can be displayed by visualizations.
        • Equivalent to catchError(message: message, buildResult: 'UNSTABLE', stageResult: 'UNSTABLE')
        • catchInterruptions has the same meaning as in the catchError  step.

2.15 (Mar 18, 2019)

  • Fix formatting issues in informational text for various steps (PR 82)
  • Internal: Update dependencies and fix resulting test failures so that the plugin's tests pass successfully when run using the PCT (PR 79)

2.14 (Jan 14, 2019)

  • JENKINS-43276: Fix potential issue where a SimpleBuildWrapper used in a Pipeline script through the general build wrapper step (wrap) could block Pipeline execution indefinitely.

2.13 (Nov 30, 2018)

  • JENKINS-54607: Fix issue where timeouts reused the timeout value instead of the grace period of 60 seconds when force killing unresponsive Pipelines after the timeout expires.
  • Improvement: Chinese localizations have been migrated to the Localization: Chinese (Simplified) Plugin.

2.8.3 (Nov 30, 2018)

  • JENKINS-54607: Fix issue where timeouts reused the timeout value instead of the grace period of 60 seconds when force killing unresponsive Pipelines after the timeout expires.

2.12 (Oct 26, 2018)

  • JENKINS-54078: Fix issue causing builds to fail when using the timeout step with activity: true

2.11 (Sep 10, 2018) - Bleeding-edge Version

  • Requires Jenkins Core 2.121.1 or newer.
  • Fix a file leak introduced in version 2.10 when using writeFile with Base64 encoding.

2.8.2 (Sep 10, 2018) - Stable Version

  • Fix a file leak introduced in version 2.8.1 when using writeFile with Base64 encoding.

2.10 (Aug 21, 2018) - Bleeding-edge Version

  • Requires Jenkins Core 2.121.1 or newer.
  • Adds support to readFile and writeFile for working with binary files by passing Base64 as the encoding. Can be used with Pipeline: Shared Groovy Libraries 2.10 or higher to copy binary files from libraries into the workspace. (JENKINS-52313)

2.8.1 (Aug 21, 2018) - Stable Version

  • Requires Jenkins Core 2.60.3 or newer.
  • Adds support to readFile and writeFile for working with binary files by passing Base64 as the encoding. Can be used with Pipeline: Shared Groovy Libraries 2.10 or higher to copy binary files from libraries into the workspace. (JENKINS-52313)

2.9 (June 15, 2018) - Bleeding-edge release

  • Requires Jenkins Core 2.121.1
  • Support for storing stashes & artifacts off-master if using an appropriate storage implementation via VirtualFile.toExternalUrl (JENKINS-49635)

2.8 (June 15, 2018) - Stable Version

  • Docs: Fixes to the Stash step help (thanks, community contributor Josh Soref!)
  • Docs: Note exception type thrown by Timeout step (thanks, community contributor Dawid Gosławski!)

2.7 (Apr 18, 2018)

  • JENKINS-46180 - Deprecated archive step will log when no files to archive are found.

  • JENKINS-48138 - Log a warning when fileExists is called with an empty string.
  • JENKINS-44379retry will no longer retry on a FlowInterruptedException, such as aborted inputmilestone steps or an aborted run.
  • JENKINS-26521 - Add activity flag to timeout step.

2.6 (Jun 30, 2017)

  • JENKINS-45101 Improved display of step summaries in Blue Ocean for various steps.

2.5 (May 30, 2017)

2.4 (Feb 10, 2017)

  • JENKINS-41276 retry now exits immediately upon receiving a user-initiated build abort.
  • Implemented virtual thread dump status for waitUntil.
  • Simplified some implementations as per JENKINS-39134.

2.3 (Nov 01, 2016)

  • JENKINS-39072 (related to JENKINS-34637): make the timeout step print more information to the log, display status in Thread Dump, and forcibly kill its body after a grace period has elapsed.
  • JENKINS-28385 Added getContext and withContext steps for use in advanced libraries.
  • Warning in documentation regarding JENKINS-38640 & JENKINS-36914.

2.2 (Sep 23, 2016)

  • JENKINS-37397 Allow use of symbols to select the type of a tool.
  • Creating the workspace directory from some steps if the step required it and it did not already exist.
  • Broken documentation link.

2.1 (Jul 28, 2016)

  • JENKINS-29922 Marking step and wrap as “metasteps”, allowing simplified syntax with Pipeline Groovy Plugin 2.10. Correspondingly deprecating the artifact step for Jenkins 2.2+ users.
  • JENKINS-34554 Maximum recurrence period for waitUntil, currently hard-coded.
  • JENKINS-34281 Indicate in the build log if sleep still applies after a Jenkins restart.
  • JENKINS-31842 Indicate in the virtual thread dump if sleep is ongoing.
  • JENKINS-29170 Snippet generation improvements for mail.
  • Some inline help fixes.

2.0 (Apr 05, 2016)