question

HanShih-1830 avatar image
0 Votes"
HanShih-1830 asked

Azure DevOps pipeline: remote powershell task seems never finish

I try the "run powershell on remote machines" task to restart my Tomcat (java) service on the Windows server.
It just keep printing useless info in the console
197694-image.png

Here is the detail about the powershell script:
1. stop Tomcat service (call a .bat file)
2. move .jar files to right location & replace old files
3. start Tomcat service (call a .bat file)

& D:\MY\PATH\stop.bat;

......
Copy-Item -Path "D:/s-1.0.jar" -Destination $sqs_path -Force;
......

& D:\MY\PATH\start.bat;



When I run the same command directly in that windows server, the "powershell part" trigger .bat script job, then get back to powershell console successfully .
Later, a new window pops out. The new window is Tomcat server that shows logs of my service.

However, when I do the same job with Azure release pipeline, the Tomcat window did not show up.
And release job console keep hanging.
I think somewhat the output of popout window has be redirected to the console in release pipeline.

In addition, if I cancel the release job. my Tomcat service still working. (just without console to debug)

Or, another thought, can I achieve my goal with other task? (powershell is not a "must")


Any suggestion would be appreciated.




windows-server-powershell
image.png (49.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers