Passing data between build steps in Jenkins

后端 未结 8 1665
臣服心动
臣服心动 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条回答
  • 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
    
    0 讨论(0)
  • 2020-12-31 00:47

    Jenkins allows you to inject environment variables to the build process. Maybe all you have to do is Inject the Start time and End Time as environment variables and access them across your build steps. enter image description here

    0 讨论(0)
提交回复
热议问题