I have a requirement let me explain scenario,
- Their is COMPUTER-A (Jenkins Server) through which we triggered pipeline build
- First Step it will create VM (COMPUTER-B) in vlab machine and get the IP
Second Step it will execute testsuites.sh in COMPUTER-B through ssh below is pseudo-code
steps { script { sh """ ssh -i id_rsa -o StrictHostKeyChecking=no ${USER}@${env.IP} "nohup /home/testsuites.sh > foo.out 2> foo.err < /dev/null & " """ } }this script is run in background "mvn clean test" which will run all test case and generate cucumber report at the end of build.
till this working fine.
Since its run in background jenkins job will not going to wait & will move to next stage
Third Step Jenkins Server COMPUTER-A will send success mail
Now the requirement is once the build is success i need to send the cucumber test report through another mail. How to notify the jenkins job in COMPUTER-A (Since its already completed) to sent mail with cucumber report file which is their in remote server COMPUTER-B.
i can run corn job to check for build success , but how to notify the jenkins to send email with the cucumber test report.