guard { build( "job1" ) build( "job2" ) build( "job3" ) build( "job4" )} rescue { build( "job_cleanup" )}Let’s see,,,
1. What SCM are you using? I use Perforce and can tell the Perforce Plugin “not” to manage “client views” and create one in a fixed location AND set the Use custom workspace in Advanced Project Options to tell each job to use the same workspace. Therefore, Jenkins will not create a workspace with the job name. you do this in each of job1, job2, job,3 etc
2. The example guarantees that sequence for this flow. If the entire flow is triggered again, it will pend until the current flow execution completes.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/2232cf8e-12b5-461a-a276-10f136166d02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Let’s see,,,
1. What SCM are you using? I use Perforce and can tell the Perforce Plugin “not” to manage “client views” and create one in a fixed location AND set the Use custom workspace in Advanced Project Options to tell each job to use the same workspace. Therefore, Jenkins will not create a workspace with the job name. you do this in each of job1, job2, job,3 etc
build( "linux-3.10.y.prep", PARENT_WORKSPACE:build.workspace, PARENT_JOB_NAME:build.job_name)[...]at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:63)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
at Script1.run(Script1.groovy:1)
at Script1$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at Script1$run.call(Unknown Source)
at com.cloudbees.plugins.flow.FlowDSL.executeFlowScript(FlowDSL.groovy:84)
at com.cloudbees.plugins.flow.FlowRun$BuildWithWorkspaceRunnerImpl.doRun(FlowRun.java:180)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
at hudson.model.Run.execute(Run.java:1744)
at hudson.model.Run.run(Run.java:1682)
at com.cloudbees.plugins.flow.FlowRun.run(FlowRun.java:153)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
FATAL: No such property: jobname for class: com.cloudbees.plugins.flow.FlowRun
groovy.lang.MissingPropertyException: No such property: jobname for class: com.cloudbees.plugins.flow.FlowRun
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:63)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
at Script1.run(Script1.groovy:1)
at Script1$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at Script1$run.call(Unknown Source)
at com.cloudbees.plugins.flow.FlowDSL.executeFlowScript(FlowDSL.groovy:84)
at com.cloudbees.plugins.flow.FlowRun$BuildWithWorkspaceRunnerImpl.doRun(FlowRun.java:180)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
at hudson.model.Run.execute(Run.java:1744)
at hudson.model.Run.run(Run.java:1682)
at com.cloudbees.plugins.flow.FlowRun.run(FlowRun.java:153)
at hudson.model.ResourceController.execute(ResourceController.java:98)
}
Getting jobs to share the same workspace can be done by “AND set the Use custom workspace in Advanced Project Options to tell each job to use the same workspace”. I must have mistakenly assumed that that workspace contains source code to be built ?????
You never asked How can I handle an environment variable set for one build to an other build?" in your original message ????
To access environment tokens in Build-flow I have used :
build.properties["environment"]["JOB_NAME"]
build.number
the first can be used to get ANY environment variable either defined by Jenkins or injected/defined in your job.
Use this groovy to get all the properties of a build:
out.println 'Build Object Properties:'
build.properties.each { out.println "$it.key -> $it.value" }
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/93c37ecf-f5c4-43f3-b061-3e17b6405a1d%40googlegroups.com.
Getting jobs to share the same workspace can be done by “AND set the Use custom workspace in Advanced Project Options to tell each job to use the same workspace”. I must have mistakenly assumed that that workspace contains source code to be built ?????
You never asked How can I handle an environment variable set for one build to an other build?" in your original message ????
To access environment tokens in Build-flow I have used :
build.properties["environment"]["JOB_NAME"]