I have Perforce and Swarm set up to trigger the Jenkins p4 plugin as written in the docs, which I have confirmed works for me on a git multibranch pipeline, where the branches' Jenkinsfile specifies `pipelineTriggers([p4Trigger()])` as part of its properties and the branch specified matches a stream name.
In an effort to do away with the multibranch pipeline for ease of adding new streams, I'm moving toward a job DSL bootstrap where I build out a set of folders under which many job pipelines are created for each stream. One of these subjobs, which shares the name of the stream ( "build-refactor" ) will act as the job to be triggered by p4trigger, and then trigger other pipeline jobs in the folder; this p4trigger job I have set up this up as follows in the pipelineJob config:
I have confirmed that this equates to checking the Perforce trigger checkbox when manually creating a pipeline, as well as setting up a script with `pipelineTriggers([p4Trigger()])`.
In order to migrate to my DSL job, I initially updated the stream/branch "build-refactor" 's multibranch pipeline Jenkinsfile to build the desired subjob, submitted a dummy CL in P4V to trigger P4 plugin, and confirmed this worked fine and all subjobs were triggered appropriately.
Leaving that multibranch pipeline->jobdsl workflow in place, I then ran my new replacement DSL-created job "build-refactor" (identical Jenkinsfile that ran successfully in the MBP). Manually running this job triggered subjobs just fine, but afterwards, new dummy CLs no longer trigger either the multibranch pipeline job, nor the DSL based job.
I'm not sure at this point if this is:
- an issue with multiple jobs being triggered by the same stream
- poor configuration on my part (I've gone through and it looks fine to me - XML, Jenkinsfile, and job configuration looks identical to me)
- whether a pipeline job can't be triggered by p4 if the multibranch pipeline already owns the trigger (perhaps some similarity to https://issues.jenkins-ci.org/browse/JENKINS-35314 )
Any guidance at this point would be helpful - my last ditch workaround will be to keep the multibranch pipeline solely around to receive the p4 trigger and route to the DSL subjobs, which is not ideal due to branch management.