I want to generalize my code so that it can pull from perforce for any files marked with a type "perforce" because some files need to downloaded from the artifactory instead. I want to sub in the variable perf[0].ID into the 'view' parameter so that I can pull different files depending on the ID. However, when I run it, it's passed in as an empty string. Does the checkout plugin not have any support for variables? If there is no support, would having a spec file give me this generality I want? Or do I need to bite the bullet, abandon the checkout plugin and make a batch script?
-->I have an array perf with a type,path,ID, and size field. Here perf[0].ID = "Linak".
stage ('Perforce binaries') {
steps {
//can do this "for perforce[].size()" on specified path
script {
for (int i = 0; i < perf.size(); i++ ) {
dir("raw/${perf[i].ID}") {
checkout perforce(credential: 'perforce_credentials', populate: autoClean(delete: true, modtime: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: true, replace: true, tidy: false), workspace: manualSpec(charset: 'none', cleanup: false, name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}', pinHost: false, spec: clientSpec(allwrite: false, backup: false, changeView: '', clobber: false, compress: false, line: 'LOCAL', locked: false, modtime: false, rmdir: false, serverID: '', streamName: '', type: 'READONLY', view: '"//depot/Software/${perf[i].ID}/..." //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/...')))
}
}
}
}
}