Jenkins email send remote server cucumber report
up vote
6
down vote
favorite
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.
jenkins cucumber jenkins-plugins jenkins-pipeline
add a comment |
up vote
6
down vote
favorite
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.
jenkins cucumber jenkins-plugins jenkins-pipeline
add a comment |
up vote
6
down vote
favorite
up vote
6
down vote
favorite
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.
jenkins cucumber jenkins-plugins jenkins-pipeline
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.
jenkins cucumber jenkins-plugins jenkins-pipeline
jenkins cucumber jenkins-plugins jenkins-pipeline
edited Nov 9 at 13:05
Navarasu
1,7881721
1,7881721
asked Nov 9 at 7:39
user1184777
36211131
36211131
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
What you need is Quiet Period
node {
build job: 'FetchCucumberReport',
quietPeriod: 60,// in secs -->1min
wait: false
}
So what the above code does is it will trigger FetchCucumberReport
Job after a 1 minute. If you roughly know how long the test cases will take to complete all tasks ( lets say 4 hours) then set quietPeriod:14400
(seconds) and it will trigger the build after 4 hours.
UPDATED
You will have to look into API calls https://wiki.jenkins.io/display/JENKINS/Remote+access+API
An e.g
curl -X POST -u user:password http://localhost:8080/job/FetchCucumberReport/build
Hope it helps :)
i cannot decide approximate time because if test cases increases it will increase time also. and the cucumber reports will be in COMPUTER-B remote server, from Jenkins Server COMPUTER-A i need to send mail along with that reports how to access that cucumber report file which is their in remote server
– user1184777
Nov 12 at 6:57
If that's the case, you will have to look into REST API calls to Jenkins to Build the Project let's call it 'SendCucumberReport'.. Basically once the test cases are done you can do a Curl to Jenkins and trigger the job(which will fetch the report from Computer B using curl/ssh/scp up to you) or You can send the report then trigger the Job either way it's how you wan to design it.
– rohit thomas
Nov 12 at 7:14
Did it help ? or are you still facing issues ?
– rohit thomas
Nov 14 at 2:33
If the issue is resolved...Please select the correct answer so that others who face similar issues will benefit..If not, please add the issues you are still facing.
– rohit thomas
Nov 16 at 4:47
add a comment |
up vote
0
down vote
You could trigger a build as soon as your long running job is finished, which just emails the results:
curl -X POST http://user:password@<jenkins-url>:8080/job/test/build
If the job can run on the same machine it should be easy to gather the results, if not, you could just copy the artifacts via scp.
But I think that another approach might be better suited for your problem. Just let the job run as long as it takes, then you can send the email afterwards much easier. If you would like to trigger another job before, you could trigger another job which runs on the same machine.
Maybe creating a temporary jenkins slave might be the best idea. You can also do this via the REST API:
Creating-node-with-the-REST-API
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
What you need is Quiet Period
node {
build job: 'FetchCucumberReport',
quietPeriod: 60,// in secs -->1min
wait: false
}
So what the above code does is it will trigger FetchCucumberReport
Job after a 1 minute. If you roughly know how long the test cases will take to complete all tasks ( lets say 4 hours) then set quietPeriod:14400
(seconds) and it will trigger the build after 4 hours.
UPDATED
You will have to look into API calls https://wiki.jenkins.io/display/JENKINS/Remote+access+API
An e.g
curl -X POST -u user:password http://localhost:8080/job/FetchCucumberReport/build
Hope it helps :)
i cannot decide approximate time because if test cases increases it will increase time also. and the cucumber reports will be in COMPUTER-B remote server, from Jenkins Server COMPUTER-A i need to send mail along with that reports how to access that cucumber report file which is their in remote server
– user1184777
Nov 12 at 6:57
If that's the case, you will have to look into REST API calls to Jenkins to Build the Project let's call it 'SendCucumberReport'.. Basically once the test cases are done you can do a Curl to Jenkins and trigger the job(which will fetch the report from Computer B using curl/ssh/scp up to you) or You can send the report then trigger the Job either way it's how you wan to design it.
– rohit thomas
Nov 12 at 7:14
Did it help ? or are you still facing issues ?
– rohit thomas
Nov 14 at 2:33
If the issue is resolved...Please select the correct answer so that others who face similar issues will benefit..If not, please add the issues you are still facing.
– rohit thomas
Nov 16 at 4:47
add a comment |
up vote
0
down vote
What you need is Quiet Period
node {
build job: 'FetchCucumberReport',
quietPeriod: 60,// in secs -->1min
wait: false
}
So what the above code does is it will trigger FetchCucumberReport
Job after a 1 minute. If you roughly know how long the test cases will take to complete all tasks ( lets say 4 hours) then set quietPeriod:14400
(seconds) and it will trigger the build after 4 hours.
UPDATED
You will have to look into API calls https://wiki.jenkins.io/display/JENKINS/Remote+access+API
An e.g
curl -X POST -u user:password http://localhost:8080/job/FetchCucumberReport/build
Hope it helps :)
i cannot decide approximate time because if test cases increases it will increase time also. and the cucumber reports will be in COMPUTER-B remote server, from Jenkins Server COMPUTER-A i need to send mail along with that reports how to access that cucumber report file which is their in remote server
– user1184777
Nov 12 at 6:57
If that's the case, you will have to look into REST API calls to Jenkins to Build the Project let's call it 'SendCucumberReport'.. Basically once the test cases are done you can do a Curl to Jenkins and trigger the job(which will fetch the report from Computer B using curl/ssh/scp up to you) or You can send the report then trigger the Job either way it's how you wan to design it.
– rohit thomas
Nov 12 at 7:14
Did it help ? or are you still facing issues ?
– rohit thomas
Nov 14 at 2:33
If the issue is resolved...Please select the correct answer so that others who face similar issues will benefit..If not, please add the issues you are still facing.
– rohit thomas
Nov 16 at 4:47
add a comment |
up vote
0
down vote
up vote
0
down vote
What you need is Quiet Period
node {
build job: 'FetchCucumberReport',
quietPeriod: 60,// in secs -->1min
wait: false
}
So what the above code does is it will trigger FetchCucumberReport
Job after a 1 minute. If you roughly know how long the test cases will take to complete all tasks ( lets say 4 hours) then set quietPeriod:14400
(seconds) and it will trigger the build after 4 hours.
UPDATED
You will have to look into API calls https://wiki.jenkins.io/display/JENKINS/Remote+access+API
An e.g
curl -X POST -u user:password http://localhost:8080/job/FetchCucumberReport/build
Hope it helps :)
What you need is Quiet Period
node {
build job: 'FetchCucumberReport',
quietPeriod: 60,// in secs -->1min
wait: false
}
So what the above code does is it will trigger FetchCucumberReport
Job after a 1 minute. If you roughly know how long the test cases will take to complete all tasks ( lets say 4 hours) then set quietPeriod:14400
(seconds) and it will trigger the build after 4 hours.
UPDATED
You will have to look into API calls https://wiki.jenkins.io/display/JENKINS/Remote+access+API
An e.g
curl -X POST -u user:password http://localhost:8080/job/FetchCucumberReport/build
Hope it helps :)
edited Nov 12 at 7:17
answered Nov 12 at 3:20
rohit thomas
1,412418
1,412418
i cannot decide approximate time because if test cases increases it will increase time also. and the cucumber reports will be in COMPUTER-B remote server, from Jenkins Server COMPUTER-A i need to send mail along with that reports how to access that cucumber report file which is their in remote server
– user1184777
Nov 12 at 6:57
If that's the case, you will have to look into REST API calls to Jenkins to Build the Project let's call it 'SendCucumberReport'.. Basically once the test cases are done you can do a Curl to Jenkins and trigger the job(which will fetch the report from Computer B using curl/ssh/scp up to you) or You can send the report then trigger the Job either way it's how you wan to design it.
– rohit thomas
Nov 12 at 7:14
Did it help ? or are you still facing issues ?
– rohit thomas
Nov 14 at 2:33
If the issue is resolved...Please select the correct answer so that others who face similar issues will benefit..If not, please add the issues you are still facing.
– rohit thomas
Nov 16 at 4:47
add a comment |
i cannot decide approximate time because if test cases increases it will increase time also. and the cucumber reports will be in COMPUTER-B remote server, from Jenkins Server COMPUTER-A i need to send mail along with that reports how to access that cucumber report file which is their in remote server
– user1184777
Nov 12 at 6:57
If that's the case, you will have to look into REST API calls to Jenkins to Build the Project let's call it 'SendCucumberReport'.. Basically once the test cases are done you can do a Curl to Jenkins and trigger the job(which will fetch the report from Computer B using curl/ssh/scp up to you) or You can send the report then trigger the Job either way it's how you wan to design it.
– rohit thomas
Nov 12 at 7:14
Did it help ? or are you still facing issues ?
– rohit thomas
Nov 14 at 2:33
If the issue is resolved...Please select the correct answer so that others who face similar issues will benefit..If not, please add the issues you are still facing.
– rohit thomas
Nov 16 at 4:47
i cannot decide approximate time because if test cases increases it will increase time also. and the cucumber reports will be in COMPUTER-B remote server, from Jenkins Server COMPUTER-A i need to send mail along with that reports how to access that cucumber report file which is their in remote server
– user1184777
Nov 12 at 6:57
i cannot decide approximate time because if test cases increases it will increase time also. and the cucumber reports will be in COMPUTER-B remote server, from Jenkins Server COMPUTER-A i need to send mail along with that reports how to access that cucumber report file which is their in remote server
– user1184777
Nov 12 at 6:57
If that's the case, you will have to look into REST API calls to Jenkins to Build the Project let's call it 'SendCucumberReport'.. Basically once the test cases are done you can do a Curl to Jenkins and trigger the job(which will fetch the report from Computer B using curl/ssh/scp up to you) or You can send the report then trigger the Job either way it's how you wan to design it.
– rohit thomas
Nov 12 at 7:14
If that's the case, you will have to look into REST API calls to Jenkins to Build the Project let's call it 'SendCucumberReport'.. Basically once the test cases are done you can do a Curl to Jenkins and trigger the job(which will fetch the report from Computer B using curl/ssh/scp up to you) or You can send the report then trigger the Job either way it's how you wan to design it.
– rohit thomas
Nov 12 at 7:14
Did it help ? or are you still facing issues ?
– rohit thomas
Nov 14 at 2:33
Did it help ? or are you still facing issues ?
– rohit thomas
Nov 14 at 2:33
If the issue is resolved...Please select the correct answer so that others who face similar issues will benefit..If not, please add the issues you are still facing.
– rohit thomas
Nov 16 at 4:47
If the issue is resolved...Please select the correct answer so that others who face similar issues will benefit..If not, please add the issues you are still facing.
– rohit thomas
Nov 16 at 4:47
add a comment |
up vote
0
down vote
You could trigger a build as soon as your long running job is finished, which just emails the results:
curl -X POST http://user:password@<jenkins-url>:8080/job/test/build
If the job can run on the same machine it should be easy to gather the results, if not, you could just copy the artifacts via scp.
But I think that another approach might be better suited for your problem. Just let the job run as long as it takes, then you can send the email afterwards much easier. If you would like to trigger another job before, you could trigger another job which runs on the same machine.
Maybe creating a temporary jenkins slave might be the best idea. You can also do this via the REST API:
Creating-node-with-the-REST-API
add a comment |
up vote
0
down vote
You could trigger a build as soon as your long running job is finished, which just emails the results:
curl -X POST http://user:password@<jenkins-url>:8080/job/test/build
If the job can run on the same machine it should be easy to gather the results, if not, you could just copy the artifacts via scp.
But I think that another approach might be better suited for your problem. Just let the job run as long as it takes, then you can send the email afterwards much easier. If you would like to trigger another job before, you could trigger another job which runs on the same machine.
Maybe creating a temporary jenkins slave might be the best idea. You can also do this via the REST API:
Creating-node-with-the-REST-API
add a comment |
up vote
0
down vote
up vote
0
down vote
You could trigger a build as soon as your long running job is finished, which just emails the results:
curl -X POST http://user:password@<jenkins-url>:8080/job/test/build
If the job can run on the same machine it should be easy to gather the results, if not, you could just copy the artifacts via scp.
But I think that another approach might be better suited for your problem. Just let the job run as long as it takes, then you can send the email afterwards much easier. If you would like to trigger another job before, you could trigger another job which runs on the same machine.
Maybe creating a temporary jenkins slave might be the best idea. You can also do this via the REST API:
Creating-node-with-the-REST-API
You could trigger a build as soon as your long running job is finished, which just emails the results:
curl -X POST http://user:password@<jenkins-url>:8080/job/test/build
If the job can run on the same machine it should be easy to gather the results, if not, you could just copy the artifacts via scp.
But I think that another approach might be better suited for your problem. Just let the job run as long as it takes, then you can send the email afterwards much easier. If you would like to trigger another job before, you could trigger another job which runs on the same machine.
Maybe creating a temporary jenkins slave might be the best idea. You can also do this via the REST API:
Creating-node-with-the-REST-API
edited Nov 18 at 9:04
answered Nov 18 at 8:59
S.Spieker
3,92152742
3,92152742
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53221560%2fjenkins-email-send-remote-server-cucumber-report%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown