Executing csession always return exit code 1.
Hi all,
I'm developing a Azure Pipeline to automate the deployment process in Caché.
I use selfhosted agent to execute code im my Caché Server.
My problem is that cession execution via cmd always terminate with exit code 1 and the pipeline finishes with error, but the execution in Caché is fine, the method executed returns $$$OK
I use the following line to execute a class in Caché.
C:\InterSystems\Cache\bin\csession.exe CACHE -U %RELEASE_TRIGGERINGARTIFACT_ALIAS% "##Class(sgf.pipeline.DeploymentManager).ProcessDeployment()"
Bellow printscreen of execution in Azure:.png)
The problem is the exit code 1
.png)
I did a local test printing the errorlevel environment variable before execution:.png)
After execution:
.png)
Regards.
Comments
As a guess the routine is returning 1 and you can demo this using @Dmitry Maslennikov suggestion:
run do $zu(4,$job,1) and check errorlevel
run do $zu(4,$job,0) and check errorlevel
Thanks @Dmitry Maslennikov and @Alexander Pettitt
I had already tested your suggestions, without success.
I'll create an environment variable with the execution result and encapsulate it in a Python script to test the result.
Regards.
Not sure about Windows and Cache, but it works with IRIS and Linux.png)
Hy guys,
In the end, I had to use an intermediate file to signal an error when executing the Caché class, because using the environment variable didn't reflect it in the process that runs csession.
I'll create an Open Exchange application with the complete solution later..png)