Passing data between build steps in Jenkins

后端 未结 8 1793
臣服心动
臣服心动 2020-12-31 00:09

I\'d like to do something along the lines of:

This is overly simple and just demonstrates what I\'d like to do. Basically, I want to be able to store and access vari

8条回答
  •  -上瘾入骨i
    2020-12-31 00:47

    One way to work with Jenkins variables is to use jenkins-cli.jar in the build step, it takes some work but this will add FOO=1 in the parameters list, since it's running in a build step it knows which build to set the parameter for.

    java -jar ${JENKINS_HOME}/war/WEB-INF/jenkins-cli.jar -s ${JENKINS_URL} set-build-parameter FOO 1
    

提交回复
热议问题