Using P4Plugin with Jenkins to publish assets


Posted by Jaime | Posted in DevOps | Posted on 28-12-2015



I was previously using the Perforce Plugin in Jenkins to handle my tasks with Perforce, including adding files that needed to be released from a build, but in the past year, I’ve experienced some weirdness that lead me to evaluate the P4Plugin by Perforce.

All of the weirdness that I saw in the prior plugin went away, but I couldn’t figure out how to publish only certain files from a build.

There wasn’t anything in the documentation instructing you on how to do this feature and when I would use the Publish Assets feature, all of the extra files created in a build would be potentially added to my project, which was not the intent of the build.

It wasn’t until I found a bug report that said the following:

The shelve publish step should use a different workspace from the populate step. The view for this workspace should be very narrow (a Virtual stream, if using streams). Typically the view should be one or two files, limiting the files it will run the reconcile over.

By the way, I still haven’t figured out how to get Virtual streams to work in the P4Plugin as the plugin won’t recognize them.

So, to be able and isolate what you want published back to your Perforce server, you have to create another workspace to isolate the files, or directories, in question.

Hopefully, Perforce will include this text in their plugin documentation sometime soon.