Jump to content

Retrieving files from 'change-content' from jenkins

triggers change-content jenki

  • Please log in to reply
4 replies to this topic

#1 dlbaz



  • Members
  • Pip
  • 3 posts

Posted 05 August 2020 - 11:01 AM

I'm wanting to do some validation on some UnrealAssets that are submitted and If the validation fails I want to reject the submission. I currently have setup a change-content trigger which calls a python script which remotely runs a Jenkins job which will sync a stream + "unpack" the submitted files then run validation on these files.

The problem is that I don't know of a nice way to get Jenkins access the changes in the submitted change list. Is there a way I can get Jenkins to access the content from these changelists, hopefully in a nice little bundle like a shelf or another changelist that I can "unpack" after I P4 sync?

Or is my only option to copy the modified/edited files to a network location which Jenkins can access and copy into a build after a p4 sync, and treat deletions as a special case by writing some custom code to read some file that would direct jenkins to delete certain files.

Any tips appreciated!

#2 dlbaz



  • Members
  • Pip
  • 3 posts

Posted 23 September 2020 - 01:25 AM

I ended up having to create a `change-commit` trigger, which calls a python script which then triggers a Jenkins job, passing in the changelist. It isn't my preference because I want to validate the assets on jenkins before the submissions.

#3 Sambwise


    Advanced Member

  • Members
  • PipPipPip
  • 1191 posts

Posted 23 September 2020 - 05:37 PM

In a change-content trigger, the in-flight changelist is accessible as something very much like a shelf.  I'm not sure offhand if you can actually "p4 unshelve" the changelist while it's in that state, but I'm positive that commands like "p4 print @=CHANGE" will work.

#4 runjam



  • Members
  • Pip
  • 1 posts

Posted 23 October 2020 - 05:11 AM

I like the post which you shared here and thanks for sharing this to us. The [url="https://peryourhealth.fun/"%5Dperyourhealth%5B/url%5D is medical billing portal. It provides patients with secure access to their account. You can use www.peryourhealth.com to pay medical bills online.

#5 Robert Cowham

Robert Cowham

    Advanced Member

  • PCP
  • 279 posts
  • LocationLondon, UK

Posted 23 October 2020 - 09:59 AM

I would recommend the use of Swarm - it is easy to setup and you shelve for review and it can trigger Jenkins (with plugin P4 Jenkins), which knows how to unshelve.

Here is a demo in docker - even if a couple of years old.

Co-Author of "Learning Perforce SCM", PACKT Publishing, 25 September 2013, ISBN 9781849687645

"It's wonderful to see a new book about Perforce, especially one written by Robert Cowham and Neal Firth. No one can teach Perforce better than these seasoned subject matter experts"
  • Laura Wingerd, author of Practical Perforce, former VP of Product Technology at Perforce

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users