-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
80 lines (80 loc) · 2.65 KB
/
Jenkinsfile
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
pipeline {
agent none
stages {
stage('Maven Install') {
agent {
docker {
image 'maven:3.5.0'
}
}
steps {
sh 'mvn clean install'
}
}
stage('Docker Build') {
agent any
steps {
sh 'docker build -t ${env.DOCKER_USER}/template-service-java-springboot:latest .'
}
}
stage('Docker Build') {
agent any
steps {
sh 'docker build -t ${env.DOCKER_USER}/template-service-java-springboot-fluentbit:latest .'
}
}
stage('Image Scan') {
steps {
prismaCloudScanImage ca: '',
cert: '',
dockerAddress: 'unix:///var/run/docker.sock',
image: 'shubham01/template-service-java-springboot:latest',
key: '',
logLevel: 'info',
podmanPath: '',
// The project field below is only applicable if you are using Prisma Cloud Compute Edition and have set up projects (multiple consoles) on Prisma Cloud.
project: '',
resultsFile: 'prisma-cloud-scan-results.json',
ignoreImageBuildTime:true
}
}
stage('Image Scan - fluentbit') {
steps {
prismaCloudScanImage ca: '',
cert: '',
dockerAddress: 'unix:///var/run/docker.sock',
image: 'shubham01/template-service-java-springboot-fluentbit:latest',
key: '',
logLevel: 'info',
podmanPath: '',
// The project field below is only applicable if you are using Prisma Cloud Compute Edition and have set up projects (multiple consoles) on Prisma Cloud.
project: '',
resultsFile: 'prisma-cloud-scan-results.json',
ignoreImageBuildTime:true
}
}
post {
always {
prismaCloudPublish resultsFilePattern: 'prisma-cloud-scan-results.json'
}
}
stage('Docker Push') {
agent any
steps {
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'DOCKER_PASSWORD', usernameVariable: 'DOCKER_USER')]) {
sh "docker login -u ${env.DOCKER_USER} -p ${env.DOCKER_PASSWORD}"
sh 'docker push ${env.DOCKER_USER}/template-service-java-springboot:latest'
}
}
}
stage('Docker Push - Fluentbit') {
agent any
steps {
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'DOCKER_PASSWORD', usernameVariable: 'DOCKER_USER')]) {
sh "docker login -u ${env.DOCKER_USER} -p ${env.DOCKER_PASSWORD}"
sh 'docker push ${env.DOCKER_USER}/template-service-java-springboot-fluentbit:latest'
}
}
}
}
}