-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpipeline_script.groovy
More file actions
23 lines (22 loc) · 1.09 KB
/
Copy pathpipeline_script.groovy
File metadata and controls
23 lines (22 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
def workspace_loc
def myImg
node{
stage('checkout_code'){
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/Dcoder99/Container-Security-With-JenkinsCI.git']]])
workspace_loc = pwd()
}
stage('build_docker_image'){
myImg = docker.build("test_image")
}
stage('static_analysis') {
build job: 'static_analysis', parameters: [string(name: 'myWorkspace', value: workspace_loc)]
}
stage('run_container'){
build job: 'run_container', parameters: [string(name: 'myWorkspace', value: workspace_loc)]
}
}
// junit is another a Pipeline step (provided by the JUnit plugin)
// for aggregating test reports.
// node is Scripted Pipeline-specific syntax that
// instructs Jenkins to execute this Pipeline (and any stages contained within it), on any available agent/node. This is effectively
// equivalent to agent in Declarative Pipeline-specific syntax.