Workspaces should already be unique to a given concurrent build of Jenkins.
You shouldn't have to do anything special to enable this.

On Mon, Feb 1, 2016, 2:38 PM niristotle okram <[email protected]>
wrote:

> Okay - i figured out the point of error. i should be using the " instead
> of ' . So it should be
>
> ws("/opt/mount1/jenkins/jobs/GoogleFlow/workspace/${env.BUILD_NUMBER}")
>
>
> On Monday, February 1, 2016 at 2:23:10 PM UTC-6, niristotle okram wrote:
>>
>> i am trying to create unique workspace for my workflow/pipeline. The
>> workspace will contain certain files that i don't want to mess up when the
>> job runs concurrently. my workflow looks something like
>>
>> node("master") {
>> stage name: 'sync', concurrency: 3
>> ws('/opt/mount1/jenkins/jobs/GoogleFlow/workspace/(${env.BUILD_NUMBER})')
>> {
>> //code block
>> }
>>
>> stage name: 'build_and_test', concurrency: 1
>>  ws('/opt/mount1/jenkins/jobs/GoogleFlow/workspace/(${env.BUILD_NUMBER})')
>> {
>>   //code block
>> }
>> stage name: 'test', concurrency: 3
>>  ws('/opt/mount1/jenkins/jobs/GoogleFlow/workspace/(${env.BUILD_NUMBER})')
>> {
>>   //code block
>> }
>> }
>>
>> I am expecting jenkins to create workspaces like inside the main/default
>> workspace (/opt/mount1/jenkins/jobs/GoogleFlow/workspace) as
>> /opt/mount1/jenkins/jobs/GoogleFlow/workspace/1
>> /opt/mount1/jenkins/jobs/GoogleFlow/workspace/2
>> /opt/mount1/jenkins/jobs/GoogleFlow/workspace/3
>>
>>
>> how do i make the env variable ${env.BUILD_NUMBER} get the value while
>> creating the workspace?
>>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/47c32643-6963-47d2-adf0-c288fe7bda35%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/47c32643-6963-47d2-adf0-c288fe7bda35%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CANHK%3DJ2SFE5TGQ_2r3oXd8mis7%2Bq__JvetXW45--A6dd%2BsbpDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to