forked from priyanshu-bhatt/DevSecOps-CI-CD-Pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CDJenkinsfile
35 lines (35 loc) · 1.01 KB
/
CDJenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
pipeline{
agent any
stages{
stage ('WorkSpace CleanUp'){
steps{
cleanWs()
}
}
stage ('checkout scm') {
steps {
git 'https://github.com/priyanshu-bhatt/DevSecOps-CI-CD-Pipeline.git'
}
}
stage('K8s'){
steps{
script{
withKubeConfig(caCertificate: '', clusterName: '', contextName: '', credentialsId: 'k8s', namespace: '', restrictKubeConfigAccess: false, serverUrl: '') {
sh 'kubectl apply -f deployment.yaml'
}
}
}
}
}
post {
always {
emailext attachLog: true,
subject: "'${currentBuild.result}'",
body: "Project: ${env.JOB_NAME}<br/>" +
"Build Number: ${env.BUILD_NUMBER}<br/>" +
"URL: ${env.BUILD_URL}<br/>",
to: 'priyansh12t@gmail.com',
attachmentsPattern: 'trivy.txt'
}
}
}