[p4] Automatic Syncs w/ Production Directories

Ivey, William william_ivey at bmc.com
Thu Sep 7 08:43:42 PDT 2006


> -----Original Message-----
> From: perforce-user-bounces at perforce.com
> [mailto:perforce-user-bounces at perforce.com]On Behalf Of 
> Weintraub, David
> 
[...]
>  
> 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.
>  
[...]
>  
> 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 

I have a couple of scripts that do something like that. I didn't
use a trigger or review, just had the scripts attempt to sync the
files each time before they are to be used.

In one case, the file to be synced is actually the script that
is running. In that case, if it succeeds in getting an updated
script, the current instance replaces itself with the new one by
exec-ing "itself". By the time it does that, it's running 
entirely out of functions loaded into the environment and doesn't
care what happens to the script file - at least in bourne shell
on Solaris. Might be issues on some other OS/shell combos. Perl
scripts would probably be fine with something like this, though.

-Wm




More information about the perforce-user mailing list