Jenkins Pipeline Job with file parameter

前端 未结 8 1950
难免孤独
难免孤独 2020-12-01 10:33

I\'m putting together a Jenkins pipeline job which will take a file parameter. I can trigger the job and point it at a file however I can\'t find where the file has ended up

8条回答
  •  Happy的楠姐
    2020-12-01 11:04

    Found a WA (Strictly for text based file input) We can use Jenkins multi-line string parameter and ask user to paste file contents to it. And in our pipeline, write contents of this parameter using pipeline step writeFile, as :

    stage('File Param WA') {
              writeFile file: 'demo.yaml', text: params.DEMO_YAML
    }
    

提交回复
热议问题