-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
33 lines (28 loc) · 883 Bytes
/
Jenkinsfile
File metadata and controls
33 lines (28 loc) · 883 Bytes
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
if( "$env.BRANCH_NAME" != "master") {
try {
timeout(time: 300, unit: 'SECONDS') { // change to a convenient timeout for you
input "Would you like to build the branch $env.BRANCH_NAME?"
}
} catch(err) { // timeout reached or input false
def user = err.getCauses()[0].getUser()
if('SYSTEM' == user.toString()) { // SYSTEM means timeout.
echo "Building of branch $env.BRANCH_NAME Aborted due to Timeout"
}else {
// Do not build the branch
echo "Building of branch $env.BRANCH_NAME Aborted by: [${user}]."
}
currentBuild.result = 'SUCCESS'
return
}
}
node(){
stage('Cleaning Workspace') {
deleteDir()
}
stage('Checkout'){
checkout scm
}
stage('Generating DSL Jobs'){
jobDsl removedConfigFilesAction: 'DELETE', removedJobAction: 'DELETE', removedViewAction: 'DELETE', sandbox: true, targets: '**/*.dsl', unstableOnDeprecation: true
}
}