Optimize Your CI/CD Pipeline
Get instant insights into your CI/CD performance and costs. Reduce build times by up to 45% and save on infrastructure costs.
jenkins-plugin-cli --plugins pipeline-utility-steps:2.16.2
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
andsha256
: Compute SHA-1 and SHA-256 hashes of files. -
verifySha1
andverifySha256
: 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
andwriteYaml
: Handles reading and writing of YAML files.readJSON
andwriteJSON
: For reading and writing JSON data.readCSV
andwriteCSV
: 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!