[p4] Automatic Syncs w/ Production Directories
Shawn Hladky
p4shawn at gmail.com
Thu Sep 7 10:11:01 PDT 2006
We have a scheduled task that runs the following pseudo-code:
LatestChange=`p4 counter change'
LastSyncedChange = <fetch from file>
if (LatestChange > LastSyncedChange) p4 sync @(LastSyncedChange +
1), at LatestChange
LastSyncedChange = LatestChange
<save to file> LastSyncedChange
This incremental sync approach is very fast. We have it running every
minute on more than a dozen servers, with no impact on Perforce server
performance. In theory, it's possible that some files will get lost in the
sync (and not accounted for on the next increment). But in practice we've
rarely seen this be an issue.
On 9/7/06, Weintraub, David <david.weintraub at bofasecurities.com> wrote:
>
> I've got an interesting question...
>
> We have an account called "merbld" that is the owner of the Perforce
> server, runs our triggers, and also is used for universal scripts and
> executables that we use in the Unix environment. I've setup most of
> merbld's directories to be Perforce clients. The merbld user has no
> write permission on the Perforce depot, but does have read permission.
>
> Users update the script or binary under merbld's control in their own
> views (so we know who made the change), and then are suppose to go to
> merbld's account and do a sync on the affected directories. What I'd
> like to do is to automate this procedure -- when a change is submitted
> that affects the merbld account, the correct merbld client is
> automatically sync'd to get the latest changes. A way of automatically
> deploying the changes.
>
> In fact, I could imagine this type of mechanism being used for
> automatically deploying production directories. Right now, it is too
> easy to go to the directory and make changes manually. We have no
> version history of the change and may not even know who made the change.
> An automated update system would make it much more likely that
> production people make their changes in Perforce, so we have a history
> of the changes.
>
> I am thinking to somehow use our review trigger to accomplish this task.
> If the review daemon determines that one of the directories it is
> watching has changed, it will automatically sync the correct production
> directory. When I used ClearCase, we used what were called exported
> dynamic views. In ClearCase, a view is equivalent to a Perforce client.
> However, unlike Perforce clients, dynamic views were constantly sync'd
> with the latest changes. Exporting a view allowed you to treat it as an
> NFS mount point. When I was using Subversion, there was a lot of chatter
> on their mailing list about setting up automatic "exports" of Subversion
> files into production directories.
>
> So, has anyone ever done anything like this in Perforce? If so, how did
> you accomplish it? Is this a feature that others would fine handy to
> have in Perforce? And, would this be a feature that should be built into
> Perforce and other version control systems
>
>
>
> --
>
> David Weintraub
>
> eval "s//" . sprintf ("%x%x%x\n", 7912476, 9676484, 1201069) . "/";
> tr/123456789abcd/acehklNoPrt !/;
> print;
> ?
> _______________________________________________
> perforce-user mailing list - perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
More information about the perforce-user
mailing list