Jenkins running parallel scripts -
i new jenkins , need help..
i have 4 shell scripts : test1.sh, test2.sh, test3.sh , test4.sh
i want test2.sh run if test1.sh runs , test4.sh run if test3.sh runs successfully. want test1.sh , test3.sh run in parallel.
how achieve in jenkins?
i using "execute shell script on remote host using ssh" , "conditional steps(multiple)" (just exploring). have set keys communicate remote server.
illustration using screen shot or other way helpful.
thank you!
first, ensure test1.sh , test3.sh return standard success code when succeed (0). simple way, works in command line, not jenkins, use command line:
((test1.sh && test2.sh) &) ; ((test3.sh && test4.sh) &)
each pair of parentheses forms subshell, double-amperands mean "if first succeeds run second", , single ampersand mean "run in backgorund". equivalent of 2 backgrounded shells each running 2 scripts, exit if first script doesn't return 0.
the jenkins-specific solution have node 2 (or more) runners. create 2 jobs, , tie both node. each job runs single shell, either test1.sh && test2.sh
, or test3.sh && test4.sh
.
Comments
Post a Comment