How to reuse an existing workspace?

11 views
Skip to first unread message

jesus fernandez

unread,
Sep 24, 2020, 10:33:35 AM9/24/20
to Jenkins Users
I am quite new to Jenkins, I have been learning on my own, I have a working freestyle project that I want to convert to pipeline now, I have the script (at least I think) but I do not know what to add to make it use the existing workspace from the freestyle job so when pulling from the SCM does not have to download the whole project again as it is 150gb. I have look into the declarative pipeline documentation what I have not found anything on this regard

Gian Maxera

unread,
Sep 24, 2020, 10:44:23 AM9/24/20
to jenkins...@googlegroups.com
I think you can use the "customWorkspace" option.

I use the declarative and scripted pipelines, so I don't know if there is that option in freestyle too.

Cheers,
Gianluca.


Il giorno gio 24 set 2020 alle ore 15:33 jesus fernandez <jesusfern...@gmail.com> ha scritto:
I am quite new to Jenkins, I have been learning on my own, I have a working freestyle project that I want to convert to pipeline now, I have the script (at least I think) but I do not know what to add to make it use the existing workspace from the freestyle job so when pulling from the SCM does not have to download the whole project again as it is 150gb. I have look into the declarative pipeline documentation what I have not found anything on this regard

--
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/2b593d9a-b949-4b81-a0a7-4b3272a01c60n%40googlegroups.com.

jesus fernandez

unread,
Sep 24, 2020, 10:57:59 AM9/24/20
to Jenkins Users
Thanks for answering so quickly, I saw this but I got confused as I do not use any node I just declared agent any and then the stages, I guess I could do it like this? 
pipeline 
{   
    agent {
        node {
            label 'master'
            customWorkspace '/MyExistingPath'
        }
    }
    options { timestamps () }
    stages{
....
Thanks
Reply all
Reply to author
Forward
0 new messages