Passing data between build steps in Jenkins

后端 未结 8 1667
臣服心动
臣服心动 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:27

    @Gurubaran's solution works for me, you need to install "Environment Injector" plugin in jenkins, then

    Step1: use shell/powershell/windows batch/etc. to create generate a properties(key=value) file. for example: the file path is $WORKSPACE/env.properties.

    Step2: Add an "Inject environment variables" component and set "Properties File Path" to $WORKSPACE/env.properties

    After Step2: You can use these environment variables in the following steps.

    Example:

提交回复
热议问题