How to use file parameter in jenkins

前端 未结 4 1040
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 14:26

I am executing parameterised build in jenkins to count no. of lines in file which has 1 file parameter. Its file location is pqr. The name of the script file is

4条回答
  •  孤城傲影
    2020-12-03 15:01

    There is a workaround for this issue https://github.com/janvrany/jenkinsci-unstashParam-library and in a pipeline script you do:

    library "jenkinsci-unstashParam-library"
    node {
      def file_in_workspace = unstashParam "file"
      sh "cat ${file_in_workspace}"
    }
    

提交回复
热议问题