Using the File Operations Plugin in Jenkins Pipelines
This article demonstrates how to install the Jenkins File Operations plugin, generate its DSL configuration, run a pipeline that creates a file, lists directory contents, and includes a sample pipeline script with logs and screenshots illustrating each step.
The author asks if anyone uses the File Operations plugin, noting its convenience compared to shell commands.
Installation of the plugin is shown via screenshots.
Next, the DSL (Domain Specific Language) for the plugin is generated, illustrated with an image.
The pipeline is then executed, as shown in another screenshot.
The pipeline script used is:
pipeline {
agent any
stages {
stage('Hello') {
steps {
script {
fileOperations([fileCreateOperation(fileContent: 'devops', fileName: 'test.json')])
sh " ls -l "
sleep 20
}
}
}
}
}Finally, the build logs are displayed in a screenshot.
DevOps Cloud Academy
Exploring industry DevOps practices and technical expertise.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.