Mail logs with Jenkins I am deploying my software on different OS ( Red hat &amp; suse) and I need to know if my latest version of the software will work. In order to check if the installation works it's enough to check some log files generated by the software.

Now I am trying to integrate some CI/CD tools and I am trying Jenkins now. I have created a pipeline which is triggered by every commit in bitbucket and I need a way to get the log files and the build status from the servers and mail them to the rest of the team.
If you're using Jenkins pipeline, you can use the email notification post action, as a way to send the message:

post {
    failure {
        mail to: 'team@example.com',
             subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
             body: "Something is wrong with ${env.BUILD_URL}"
    }
}


(you would have to configure the server and credentials for your case)

The message itself can be constructed from the job data. The easiest way is perhaps to tee the output of the job to a file and use it as an artifact to attach to the message that gets sent.