I am currently writing a Jenkins job to connect to different sql servers to check if all the application servers are up and running.
What I want to achieve:
Connect to QA SQL Server, run the query to verify server status.
Parse the Jenkins log and If any of the servers is down, send a mail to destination1@abc.com
with the server name and server id.
Connect to Parallel SQL Server, run the query to verify server status.
Parse the Jenkins log and If any of the servers is down, send a mail to destination2@abc.com
with the server name and server id.
Challenge I am facing:
I have used 2 build steps (Windows batch command) i.e. one for parallel and one for QA. But, if the first one fails, Jenkins doesn't execute the second one.
Can someone please suggest how this can be achieved?
答案 0 :(得分:0)
经典的解决方案是使用JENKINS Post build task
将第二个构建步骤编写为构建后步骤即使第一个构建步骤失败,也会执行该构建步骤。
但更现代和合乎逻辑的解决方案是使用JENKINS Multijob Plugin甚至Jenkins pipelines, as shown in "Jobs in parallel"在自己的工作中执行它们。