curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/master/contrib/install.sh | sh -s -- -b /usr/bin
pipeline {
agent any
stages {
stage('Download trivy-redis report') {
steps {
sh 'trivy image redis > trivy_redis.txt'
}
}
}
post {
always {
archiveArtifacts artifacts: 'trivy_redis.txt', onlyIfSuccessful: true
emailext attachLog: true, attachmentsPattern: 'trivy_redis.txt',
body: "Trivy for redis has scanned.Please stay tuned for updates. More info at: ${env.BUILD_URL}",
to: "abishek.kafle@hicare.in",
subject: "Jenkins Build ${currentBuild.currentResult}: Job ${env.JOB_NAME}"
}
}
}