Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-62123

P4 Plugin should allow checkout to subdirectory

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • p4-plugin

      In the P4Jenkins plugin, please add the functionality to "checkout to subdirectory" when defining either "Stream" or "View Mappings". 

      Customer would like to have the functionality to define a stream, and also have this stream checkout into a sub directory in the Jenkins workspace without having to fill in the "View Mappings" from a client spec by hand, with the directory present. 

          [JENKINS-62123] P4 Plugin should allow checkout to subdirectory

          Karl Wirth added a comment -

          Hi dand

          I think I'm going to link this request to JENKINS-47005 if that's acceptable.

          Are you using Freestyle or pipeline jobs? In pipeline you can use the 'ws' directive as  workaround. For example the following sets the root directory for the command in brackets to '/var/lib/jenkins/XXXXX/KarlTest':

          pipeline {
            agent { label 'master' }
            stages {
              stage("SyncMyWorkspace") {
                steps {
                   ws('/var/lib/jenkins/XXXXX/KarlTest/') {
              p4sync charset: 'none', credential: 'JenkinsMasterAdminUser', format: 'jenkins-${NODE_NAME}-${JOB_NAME}', populate: autoClean(delete: true, modtime: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: true, replace: true, tidy: false), source: depotSource('//depot/test/...')
                     }
                }
              }
            }
          }
          

           

           

          Karl Wirth added a comment - Hi dand I think I'm going to link this request to JENKINS-47005 if that's acceptable. Are you using Freestyle or pipeline jobs? In pipeline you can use the 'ws' directive as  workaround. For example the following sets the root directory for the command in brackets to '/var/lib/jenkins/XXXXX/KarlTest': pipeline { agent { label 'master' } stages { stage( "SyncMyWorkspace" ) { steps { ws( '/ var /lib/jenkins/XXXXX/KarlTest/' ) { p4sync charset: 'none' , credential: 'JenkinsMasterAdminUser' , format: 'jenkins-${NODE_NAME}-${JOB_NAME}' , populate: autoClean(delete: true , modtime: false , parallel: [enable: false , minbytes: '1024' , minfiles: '1' , threads: '4' ], pin: '', quiet: true , replace: true , tidy: false ), source: depotSource(' //depot/test/...') } } } } }    

          Dan Dawson added a comment - - edited

          Hi p4karl,

          This ticket was tested with a 'Freestyle' job, as with the customer's setup. 

          Linking it to that ticket sounds good to me. 

          Thanks!

          Dan Dawson added a comment - - edited Hi p4karl , This ticket was tested with a 'Freestyle' job, as with the customer's setup.  Linking it to that ticket sounds good to me.  Thanks!

          Karl Wirth added a comment -

          Hi dand - Thanks.

          Karl Wirth added a comment - Hi dand - Thanks.

            Unassigned Unassigned
            dand Dan Dawson
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: