Is there a way to set a Global Variable to entire jenkins cluster from a pipeline?

40 Views Asked by At

My jenkins stack is 3 machines, which are set as 1 master and 2 agents

I want to set a variable in my pipeline this variable changes after every run. and stores a result

here is my big challenge :

I want to access this result

Lets say this is a result of COUNT(*) of my restored database and I want to check whether this has been grown or not

Is there a way to set a global variable on all of my running agents to get that result and compare it through the pipeline and change it ?

I Run a simple pipeline which produce a results and i expected to store this result in a way that all of my running agents would access it in next running pipelines

1

There are 1 best solutions below

0
On BEST ANSWER

This feels like it can be accomplished using the envinject plugin. The plugin allows you to have environment variables that are common to all your pipelines, and can be accessed and changed from within your pipeline. It also allows saving and retrieving variables from files if it becomes necessary.