|
||
|
|
|
Compass Version 1.3
Update the p4 Build Plan To Build On Repository ChangesAt the end of the previous section we finished with a build plan that was scheduled to execute every 3 hours, but what if we also want to have the build plan execute every time the repository changes. To do this we have to change the Argument Checkout and Update scripts to be Revision Checkout and Update scripts. After doing this our build plan now looks like this: ![]() As you can see, we changed the two scripts to use 'Perforce Revision Checkout' and 'Perforce Revision Update'. We also deleted the arguments since these two scripts do not require any arguments to be passed to them. If we only wanted to schedule this build plan to execute on revision changes, then we would be done. However, because we also want the build to still execute every 3 hours we have some more work to do. We have to fill in default values for the two perforce scripts. The reason we have to fill in defaults is because when a Perforce Revision script is run from a source-code change trigger, it is provided with the server URL, path and revision by the trigger. But when the build isn't triggered it must know what the parameters are, just like when we scheduled the build using arguments, and we provide these parameters through default arguments. In both the 'Perforce Revision Checkout' and 'Perforce Revision Update' scripts we update the defaults the same way and here is what the defaults dialog looks like after this modification: ![]() These are the same values as are set in the Compass p4 source-control server settings and also the same values as we were using for the argument checkout. Now that we've set the default arguments for both perforce scripts, all that is left to do is schedule the build. To do this, we open the schedule build dialog and click on the 'Revision' Tab. On this tab we select the perforce example_code server and we set the path to watch to be the root path for our directory which is //depot/trunk/.... After setting the path the dialog looks like this:
After clicking 'OK' Compass will execute this build plan every time the repository changes. |







