11-24-2020 07:54 AM - edited 11-24-2020 08:04 AM
Hi All,
its my first issue entry and I hope im right here. My problme is this. I try to deploy a project with the command line feature of the deployment utility. If I use all necessary options the deploy starts and works fine. The project is being built successfully. But the command returns the exit code 2. I get the same exit code when the built isn't successfully.
Since I'm using the command line function in a Jenkins batch Script the Jenkins stage is always aborting.
Is that correct behavior? What can I do? The exit code should be zero if the built was successfully. I dont want to interpret the log file.
I use following command line options:
"C:\\Program Files (x86)\\National Instruments\\TestStand 2017\\Bin\\BuildTSD.exe" /deployTSWorkspace TRUE /workspacePath "example.tsw" /DeployEnvironmentFile TRUE /ActiveEnvironmentFile Environment\Environment.tsenv /createInstaller TRUE /installationName "Installer_example" /installerDirectory "example_Inst" /startMenuItemGroup "example" /defaultInstallationBaseDir ProgramFiles /doNotAskUserForInstallationDirectory FALSE /installerLanguage "German" /installTSEngine TRUE /hideLicenseDialog TRUE /manufacturer "example gmbH" /versionString "0.0.1" /copyLogFiles "deployLog" /SaveTSDFile "example.tsd" /UpgradesandPatchesToInclude "TSEngineandDrivers" "example.tsd"
Best regards
Lutz
05-01-2024 10:48 AM
Too late for this reply, but this thread helped me to solve exit code 2 issue I chased around for a while
Exit code 2 stands for Aborted Build:The TSDU was aborted while building, the installer was not built.
Exit code 2 happened to me only when I built package using teststand environment file. Without TS environment, there was no issue.
A little note use $? command: $? helps to find that status of last exeuction True means all went well and False means something failed. Second time sending $? basically fetchs result of previous $? execution, since it executed well and so you will find found the result of previous $? command. You can also use $LastExitCode to know last execution status with exact exit code returned from execution.
What I found eventually is that, if the environment file path given in both places, one in command line using the argument /ActiveEnvironmentFile and second in the UI below, then exit code 2 occurs.
I unchecked "Use Environment File To Determine Deployed File Destinations" as well when I give below command. I suspect that could also get conflict if I give in both command line and UI checkbox
/DeployEnvironmentFile true
--
Regards,
08-22-2024 03:11 PM
Other finding worth sharing here for anyone to help regarding TSD.
Error: We found build failed sometimes with error as Deploy files from directory field not found
Reason: Likely you have cloned repo to regular-user-documents location that caused this error. You may find, if you open TSD file from repo in non-user-documents folder like C:\Temp\ , the image and package destinations still points to users-documents though you have opened it from C:\Temp\
Solution: Keep the repo in non-user-documents folder like C:\Temp\ and update the destination again to the repo location like C:\Temp\Project\Builds location (inherently TSD determines the relative path when you choose Builds folder inside repo), then save TSD.