forked from bloomberg/bde
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
53 lines (52 loc) · 2.15 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 {
label 'BDEBLL' //pick a build agent with label
}
options {
disableConcurrentBuilds() //this job never build concurrently
buildDiscarder(logRotator(numToKeepStr: '15')) //log rotation, keep 15 builds
skipDefaultCheckout() //skips default checkout of this repo
timeout(time: 120, unit: 'MINUTES') //set timeout for this job
}
stages { //stages
stage('Print environment') { //define a stage
steps {
echo "checking out important environments "
//tells you which user are you running this job as
//what is the current directory this job is running at
//on which host
sh '''
whoami
pwd
uname -a
'''
}
}
stage('Run BDE CI Bot'){
when {
branch "PR-*" // a stage only runs for pull requests
}
steps{
echo 'Running BDE CI Bot'
sh """
/opt/bb/bin/python3.8 /bb/bde/bbshr/bde-ci-tools/bin/bdecibot.py --verbose --nolint --url ${CHANGE_URL} --create-checkout ${WORKSPACE}
"""
}
}
}
post { //after the build, clean up
always {
echo 'cleaning up the workspace'
deleteDir()
}
failure { //notify someone if the build fails
mail bcc: '', //tweak from/to/subjects to use
cc: '',
replyTo: '',
from: '[email protected]',
to: env.CHANGE_AUTHOR + '@bloomberg.net',
subject: 'Build status of job :'+ env.JOB_NAME,
body: env.BUILD_URL + ' Failed!'
}
}
}