Jenkins: How to use a variable from a pre-build shell in the Maven “Goals and options”

后端 未结 6 1537
别跟我提以往
别跟我提以往 2020-12-24 12:20

I have a Maven job in Jenkins. Before the actual build step I have an \"Execute shell\" pre-build step. In that shell I set a variable:

REVISION=$(cat .build         


        
6条回答
  •  温柔的废话
    2020-12-24 12:39

    You're on the right track here, but missed a third feature of the EnvInject-Plugin: The "Inject environment variables" build step that can inject variables into following build steps based on the result of a script or properties.

    We're using the EnvInject plugin just like that; A script sets up a resource and communicates its parameters using properties that are then propagated by the plugin as environment variables.

    i.e. setting up a temporary database for the build: Create a database for the build

提交回复
热议问题