Limited checkout in declarative pipeline

10 views
Skip to first unread message

Eric Nondahl

unread,
May 26, 2017, 8:56:09 AM5/26/17
to Jenkins Users
Hi,

I'd like to switch over to using declarative pipelines, and i'm seeing a SVN switching issue - but maybe i'm just not structuring this correctly. In this simple example pipeline, the pipeline is stored in a "project/pipelines" folder (not at the project root.) When the pipeline starts, it checks out project/pipelines as one would expect - and then checks it out again when the stage starts. Then, when I want to checkout the full "project" directory to do work, it checks it out in the same directory as the stage pipeline, causing a long and seemingly wasteful SVN switch.

I'd like to avoid checking out the full project for the pipeline on the master initially because it is large, and we'd like to avoid workspaces on the master. Is there a way to isolate the pipelines folder from the rest of the project while avoiding a long SVN Switch from subfolder to parent folder? 

Structure:
LargeProject
LargeProject/pipelines/pipeline.groovy

pipeline.groovy:
 
pipeline {
    agent {label 'FirstLabel'}

    triggers {
        pollSCM 'H/5 * * * *'
    }

    stages {
        stage('Compile') {
            steps {
                // (checkout full project - any way to isolate this so that it doesn't switch from the pipelines/ checkout?
                // (do compile)
            }
        }
    }
}

Running this shows:
1. master: checkout LargeProject/pipelines
2. FirstLabel node: checkout: LargeProject/pipelines
3. FirstLabel node: SVN Switch to LargeProject (takes a while...)

Thanks for any thoughts into this setup and how to resolve. I'd like to use declarative for the configuration support.


Reply all
Reply to author
Forward
0 new messages