forked from bloomberg/bde
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
55 lines (53 loc) · 2.32 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
54
55
pipeline {
agent { //pick a build agent with label BLDLNX.
label 'BDEBLL' //Sandbox can use BLDLNX/BLDIBM/BLDSUN,
//GNRLD/GNRIBM/GNRSUN
}
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 """
PATH=/bb/bde/bbshr/bin/:$PATH /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: 'bdebuild@jaas.dev.bloomberg.com',
to: env.CHANGE_AUTHOR + '@bloomberg.net',
subject: 'Build status of job :'+ env.JOB_NAME,
body: env.BUILD_URL + ' Failed!'
}
}
}