-
-
Notifications
You must be signed in to change notification settings - Fork 387
/
Jenkinsfile
53 lines (53 loc) · 1.3 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
pipeline {
agent any {
tools {
nodejs 'node19'
}
environment {
SCANNER_HOME = tool 'sonar-scanner'
}
stages {
stage('Git Checkout') {
steps {
git branch: 'main', url: 'https://github.com/Curtis-Thomas/free-api-list-with-react.git'
}
}
stage('Quality Gate') {
steps {
script {
waitForQualityGate abortPipeline: false, credentialsId: 'Sonar-token'
}
}
}
stage('OWASP File Security Scan') {
steps {
script {
dependencyCheck additionalArguments: '', odcInstallation: 'DP-Check'
}
}
}
stage('Trivy File System Scan') {
steps {
sh 'trivy fs .'
}
}
stage('Docker Build and Push') {
steps {
script {
withDockerRegistry(credentialsId: 'docker') {
sh 'docker build -t dockerusername:latest .'
sh 'docker tag dockerusername/latest repotag/swoc:latest'
// Consider merging or removing this line
sh 'docker push repotag/swoc:latest'
}
}
}
}
stage('Deploy to Container') {
steps {
sh 'docker run -d -p 80:80 dockerusername/swoc:latest'
}
}
}
}
}