-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathJenkinsfile
57 lines (54 loc) · 1.5 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
pipeline {
agent any
tools {
maven 'Maven_3_8_7'
}
stages {
stage('CompileandRunSonarAnalysis') {
steps {
withCredentials([string(credentialsId: 'SONAR_TOKEN', variable: 'SONAR_TOKEN')]) {
bat("mvn -Dmaven.test.failure.ignore verify sonar:sonar -Dsonar.login=$SONAR_TOKEN -Dsonar.projectKey=easybuggy -Dsonar.host.url=http://localhost:9000/")
}
}
}
stage('Build') {
steps {
withDockerRegistry([credentialsId: "dockerlogin", url: ""]) {
script {
app = docker.build("asecurityguru/testeb")
}
}
}
}
stage('RunContainerScan') {
steps {
withCredentials([string(credentialsId: 'SNYK_TOKEN', variable: 'SNYK_TOKEN')]) {
script {
try {
bat("C:\\snyk\\snyk-win.exe container test asecurityguru/testeb")
} catch (err) {
echo err.getMessage()
}
}
}
}
}
stage('RunSnykSCA') {
steps {
withCredentials([string(credentialsId: 'SNYK_TOKEN', variable: 'SNYK_TOKEN')]) {
bat("mvn snyk:test -fn")
}
}
}
stage('RunDASTUsingZAP') {
steps {
bat("C:\\zap\\ZAP_2.12.0_Crossplatform\\ZAP_2.12.0\\zap.sh -port 9393 -cmd -quickurl https://www.example.com -quickprogress -quickout C:\\zap\\ZAP_2.12.0_Crossplatform\\ZAP_2.12.0\\Output.html")
}
}
stage('checkov') {
steps {
bat("checkov -s -f main.tf")
}
}
}
}