I am running two jobs in jenkins in two pipeline. These two projects use build parameter from a previous build. These build parameters are created as follows:
def buildVariables = lastSuccBuild.getBuildVariables()
nextPluginVersion = buildVariables.get("PluginNextVersion")
List<StringParameterValue> parameterValuesAl = new ArrayList<StringParameterValue>();
parameterValuesAl.add(new StringParameterValue("PluginNextVersion", nextPluginVersion.toString()))
parameterValuesAl.add(new StringParameterValue("PluginMajorVersion", majorVersion.toString()))
parameterValuesAl.add(new StringParameterValue("PluginBuildVersion", buildVersion.toString()))
def versions = new ParametersAction(parameterValuesAl)
// add variable to current job
Thread.currentThread().executable.addAction(versions)
} catch (Throwable t) {
println(t)
t.printStackTrace()
throw t;
}
Both the jobs uses same script with same variables.
Can this cause a problem if two builds execute simultaneously?