Refer Here for the changes which include tghe Environmental variables
Mail Sending in the case of scripted pipeline
node {
try {
stage('test') {
sh 'echo hello'
}
stage('learning') {
git url: 'https://github.com/GitPracticeRepo/game-of-life.git',
branch: 'master'
}
}
catch(err) {
mail subject: "Build Failed for Jenkins JOB $env.JOB_NAME with Build ID $env.BUILD_ID",
body: "Build Failed for Jenkins JOB $env.JOB_NAME",
to: 'qtdevops@gmail.com'
}
finally {
mail subject: "Build Completed for Jenkins JOB $env.JOB_NAME",
body: "Build Completed for Jenkins JOB $env.JOB_NAME \n Click Here: $env.JOB_URL",
to: 'qtdevops@gmail.com'
}
}
Static Code Analysis And Quality Gates
For every commit it is difficult & time consuming to review the code manually on application features, language best practices, code coverage (unit test imporovements) etc..
Static Code Analysis tools can scan the code for
Language Best Practices
Code Coverage
Design issues
Security Issues (SAST, SCA)
Sonarqube is the tool which can perform static code analysis.
If you want your ci/cd pipeline to consider build as failure if the report from static code analysis is not ok/ not meeting your organization criteria, then we need to implement Quality Gate.
Package Repository or Artifact Repository
During CI/CD we build packages. If we want to store these packages in some repository so that we can deploy any version on our Dev, QA, UAT, PROD environments
There are lot of options here, But JFrog/Artifactory is widely adopted Refer Here