-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.seg
42 lines (39 loc) · 1021 Bytes
/
Jenkinsfile.seg
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
pipeline {
agent any
options {
timeout(time: 2, unit: 'MINUTES')
}
environment {
ARTIFACT_ID = "elbuo8/webapp:${env.BUILD_NUMBER}"
}
stages {
stage('Building image') {
steps{
sh '''
cd webapp
docker build -t testapp .
'''
}
}
stage('Run tests') {
steps {
sh "docker run testapp npm test"
}
}
stage('Deploy Image') {
steps{
sh '''
docker tag testapp 127.0.0.1:5000/mguazzardo/testapp
docker push 127.0.0.1:5000/mguazzardo/testapp
'''
}
}
// stage('Vulnerability Scan - Docker ') {
// steps {
// //sh "docker run -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy image --severity=critical 127.0.0.1:5000/mguazzardo/testapp"
// sh "docker run -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy image --severity=CRITICAL 127.0.0.1:5000/mguazzardo/testapp"
//
// }
// }
}
}