开发者

Can a script be automated after a commit on Perforce?

We use Perforce at work, and routinely keep software projects in the repository. In general creators follow the normal Perforce flow, BUT we also have a class of users, who doesn't have any need to edit the files but only read them. Currently we use P4Web but that requires the user so download each file individually to reassemble the开发者_如何学运维 project directory. Ideally I would like to have a process where when a user does a commit/submit in Perforce, the script would automatically run to generate a single zip file of the project directory and files, so that it was a one-click download that was guaranteed to be correct against current state of the source files. I know Git has a post-commit hook which could be used for this, but I can't figure out an equivalent function in Perforce.


Short answer: Yes, read the documentation, page 103.

Here is a link to all of the documentation available from Perforce.

Long answer, you can edit the triggers by typing p4 triggers from the command line. You provide the name of the trigger (i.e. "my_archive"), the type of trigger (i.e. change-commit in your case), path (i.e. the //depot/path/to/the/directory/that/contains/the/files/to/zip/...), and the command_path (your script), plus any variables to pass along to your script.

Really, take a look at the docs, it is really quite simple and powerful.


If they just need read access, then just give them read access in the p4protect table. That way you avoid having to mess around with snapshots of your repository.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜