Step 1: Copy the exported JSON build file to the current machine and double check the file paths in the build file are appropriate to the current environment.
Step 2: Copy the application source code (including PBT, PBL, PBR, images, INI etc.) to the current machine, or configure the build file to download source code from the source control server.
Step 3: In the command-line window, execute the PBAutoBuild220.exe file and the build file. For example,
PBAutoBuild220.exe /f "D:\PB2022\SalesDemo\ps_salesdemo.json" /l Log_PSBuild.log /le Log_PSError.log /lu Log_PSUnsupport.log
The PBAutoBuild220.exe file can be run with several parameters. For a complete list, refer to Build & deploy using commands.
Step 4: Carefully check the information in the command-line window to make sure the build and deploy process is successful.
The build file and commands used in this tutorial can be downloaded from https://github.com/Appeon/PowerBuilder-AutoBuild-Sales-Example. After you download these files to D:\PB2022\SalesDemo\, you can follow the instructions in the readme file.
After executing the PBAutoBuild220.exe file and the build file, you
can check if the execution is successful via the Windows command
errorlevel
:
-
errorlevel = 0 indicates the process was successful.
-
errorlevel = 1 indicates the process encountered an error.
You can write scripts as below to check the execution result:
Echo off PBAutoBuild220.exe /f "D:\PB2022\SalesDemo\ps_salesdemo.json" /l Log_PSBuild.log /le Log_PSError.log /lu Log_PSUnsupport.log If %ERRORLEVEL% == 0 ( echo Run PBAutoBuild successfully. ) Else ( echo Failed to run PBAutoBuild, Errorlevel is %ERRORLEVEL%. )