Executing additional commands
The entire build & deploy process is made up of
several steps, and additional commands can be executed before
and/or after some particular steps such as the “SourceControl”
and “BuildJob” steps.
For example, to add commands to remove the “build” folder
before downloading the source code:
Step 1: Create a bat file which contains the following
command, and save the bat file as Command_DeleteFolder.bat.
|
1 |
RMDIR /s /q "D:PB2021SalesDemoBuild" |
Step 2: In the exported build file, locate the “BuildPlan”
section and then the “PreCommand” sub-section; and add the file
path and name of Command_DeleteFolder.bat.
|
1 2 3 4 5 6 |
"BuildPlan": { "SourceControl": { "PreCommand": <span><strong>"Command_DeleteFolder.bat",</strong></span> "SVN": [ ... ], |
When the PBAutoBuild210.exe command is executed
later, it will execute the commands in Command_DeleteFolder.bat before it
downloads the source code.
Besides the “PreCommand” sub-section, there is also a
“PostCommand” sub-section for the “SourceControl” and “BuildJob”
steps, which allows you to execute commands after that
particular step.