The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.
For a list of other such plugins, see the Pipeline Steps Reference page.
withFileParameter
: Bind file parameterHow to use it in a declarative pipeline:
pipeline { agent any parameters { base64File 'THEFILE' } stages { stage('Example') { steps { withFileParameter('THEFILE') { sh 'cat $THEFILE' } } } } }
allowNoFile
. In this case your Pipeline must take into account the possibility that the file does not exist:
pipeline { agent any parameters { base64File 'THEFILE' } stages { stage('Example') { steps { withFileParameter(name:'THEFILE', allowNoFile: true) { sh 'if [ -f "$THEFILE" ]; then cat $THEFILE; fi' } } } } }
name
String
allowNoFile
(optional)
boolean
Please submit your feedback about this page through this quick form.
Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?
See existing feedback here.