I am using Jenkin Pipeline jobs:
What I am trying to do ?
1. There is a Job-1
2. Job 1 has lot of builds.
3. During the build run store some information in the build.Ex: Deployed version of the application
4. Access the stored information from other Job-2.
5. From Job-2 I can able to access the basic build information like BUILD_NUMBER, GIT_BRANCH etc..,
6. Even i can able to add some information in the build description and able to access it from Job-2. But i would like to store and retrieve lot of information . So storing it in build description looks messy.
I don't want to use Files or other ways mentioned in the below thread. Hudson: What is a good way to store a variable between the two job runs?
So what I've tried :
1. Job-1 , Use envInject variable to define variables
2. Job -1 ,Updated the environment variables dynamically in groovy. Ex. env.version = '1.2'
3. Access the added environment variables from Job-2.
4. Its not giving the correct updated value, Environment variables always have the initial value configured in the Jobs configuration page.
Please provide some suggestions.