forked from openshift-eng/aos-cd-jobs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
49 lines (47 loc) · 1.06 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
properties(
[
disableConcurrentBuilds()
]
)
// https://issues.jenkins-ci.org/browse/JENKINS-33511
def set_workspace() {
if(env.WORKSPACE == null) {
env.WORKSPACE = pwd()
}
}
node('buildvm-devops') {
try {
timeout(time: 30, unit: 'MINUTES') {
deleteDir()
set_workspace()
stage('clone') {
dir('aos-cd-jobs') {
checkout scm
sh 'git checkout master'
}
}
stage('run') {
sshagent(['openshift-bot']) { // git repo privileges stored in Jenkins credential store
sh '''\
virtualenv env/
. env/bin/activate
pip install gitpython
export PYTHONPATH=$PWD/aos-cd-jobs
python aos-cd-jobs/aos_cd_jobs/pruner.py
python aos-cd-jobs/aos_cd_jobs/updater.py
'''
}
}
}
} catch(err) {
mail(
to: '[email protected], [email protected]',
from: "[email protected]",
subject: 'aos-cd-jobs-branches job: error',
body: """\
Encoutered an error while running the aos-cd-jobs-branches job: ${err}\n\n
Jenkins job: ${env.BUILD_URL}
""")
throw err
}
}