New to Jenkins - use existing Perforce workspace?

12 views
Skip to first unread message

Bob S

unread,
Jan 15, 2021, 8:46:21 AM1/15/21
to Jenkins Users

Hello - I just started using Jenkins.  I wanted to use it to do automated builds of our Perforce depot.  From everything I am reading, it seems like Jenkins wants to make its own perforce workspace when it does syncing and builds.  I spent most of yesterday trying to get it to work with our existing Perforce workspace.  Can it not do that easily?

Our existing workspace is huge, soi I don't really want it to make another copy.  Also Jenkins wants to put its workspace deep within its JENKINS_HOME folder.

I was finally able to get it to sync and build in a place other than the home folder, although I could never make it use the existing workspace, using something like this:

pipeline {
 
    agent {
        label {
            label ""
            customWorkspace "E:\\Perforce\\Jenkins"
        }
    }

    stages {
        stage('Sync') {
              steps() {
                 ws(' E:\\Perforce\\Jenkins ') {
                  p4sync(
                        charset: 'none',
                        credential: 'perforce_user',
                        populate: syncOnly(force: false, have: true, modtime: false,
                        parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'],
                        pin: '', quiet: true, revert: false),
                        stream: '//Depot/main'
                    )
                }
              }
        }
    }
}

But then if I try to use a different job to do something in the same workspace, it wants to sync the entire thing again - even though the files are all there and up to date?

What am I not getting about all of this?  Can anyone help?

Thanks!

Reply all
Reply to author
Forward
0 new messages