forked from dachiefjustice/railsgoat-cicd-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
38 lines (33 loc) · 974 Bytes
/
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
/*
- Jenkinsfile for holding RailsGoat and ZAP open together (for one-off commands)
*/
pipeline {
agent any
stages {
stage('build') {
steps {
// Check out source code into the workspace, initializing RailsGoat submodule
checkout scmGit(
branches: [[name: '*/main']],
extensions:
[submodule(recursiveSubmodules: true, reference: '')],
userRemoteConfigs: [[url: 'file:///vagrant']]
)
// Build required containers
sh 'docker-compose --file $WORKSPACE/sec-tests/hold-open/compose.yaml build'
}
}
stage('hold-open') {
steps {
// Hold ZAP and RailsGoat open together
sh 'docker-compose --file $WORKSPACE/sec-tests/hold-open/compose.yaml up zap-holdopen-with-railsgoat'
}
}
}
post {
always {
// Stop running containers
sh 'docker-compose --file $WORKSPACE/sec-tests/hold-open/compose.yaml stop'
}
}
}