Skip to main content
← Back to workflows

How to Streamline Jenkins Automation?

pipeline-utility-steps -
Jenkins Plugin
v.2.16.2
248
Required Jenkins: v.2.414.3
ID: pipeline-utility-steps
Contributors
Contributor - rsandellContributor - basil
Categories
CICUBE ANALYTICS INSIGHTS
Engineering Velocity: 25% Team Time Lost to CI Issues
View Platform →
3.5h
Time Saved/Dev/Week
40%
Faster Releases
Click for next insight
Installation with the CLI tool
jenkins-plugin-cli --plugins pipeline-utility-steps:2.16.2

pipeline-utility-steps-plugin logo

Pipeline Utility Steps

Small, miscellaneous, cross platform utility steps for Jenkins Pipeline jobs.


What is Pipeline Utility Steps Plugin?

This plugin for Jenkins provides a range of small, cross-platform utility steps designed to enhance the functionality of Jenkins Pipeline jobs. These utility steps offer varied functionalities for file operations, handling of compressed archives, configuration file manipulation, and more, making it easier to automate and manage tasks within Jenkins pipelines. The plugin supports operations such as file searching, content appending, timestamp updating, hash computing and verification, and file output stream management

What is implemented Steps in Pipeline Utility Steps Plugin?

  • File System Operations:
    • findFiles: Lists files in the workspace and returns an array of FileWrappers.
def files = findFiles(glob: '**/TEST-*.xml')
echo """${files[0].name}
${files[0].path}
${files[0].directory}
${files[0].length}
${files[0].lastModified}"""
  • prependToFile: Prepends content to a file in the workspace, creating it if it doesn't exist.

  • touch: Updates or sets the timestamp of a file.

  • sha1 and sha256: Compute SHA-1 and SHA-256 hashes of files.

  • verifySha1 and verifySha256: Verify the SHA-1 and SHA-256 hashes of files.

  • tee: Outputs the Tee command to a file.

  • Working with Tar/tar.gz/tgz Files:

    • tar: Creates a tar file.
    • untar: Extracts contents from a tar file.
  • Zip File Management:

    • zip: Creates a zip file.
    • unzip: Extracts or reads a zip file.
  • Configuration Files Handling:

    • readProperties: Reads Java properties from files or text.
    • readManifest: Reads a Jar manifest.
    • readYaml and writeYaml: Handles reading and writing of YAML files.
    • readJSON and writeJSON: For reading and writing JSON data.
    • readCSV and writeCSV: Manages CSV file reading and writing.
  • Maven Project Files:

    • readMavenPom: Reads a Maven project into a Model data structure.
    • writeMavenPom: Writes a Model data structure to a file.
  • Jenkins Specific:

    • nodesByLabel: Lists nodes by label, typically excluding those that are offline.
  • Miscellaneous:

    • compareVersions: Compares two version numbers.

This plugin is incredibly useful for automating and managing various tasks within our Jenkins pipelines, making our workflows more efficient and streamlined. Let’s discuss how we might integrate these utilities into our existing processes!