-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathpr-processor-pipeline
59 lines (53 loc) · 1.9 KB
/
pr-processor-pipeline
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
56
57
58
59
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
}
parameters {
string(name: 'PULL_REQUEST_PROCESSOR_HOME', defaultValue: '/opt/tools/pr-processor/', description: 'pr-processor home')
}
environment {
HERA_USERNAME = 'jenkins'
HERA_HOSTNAME = 'olympus'
}
stages {
stage('Prep') {
steps {
cleanWs()
script {
dir('hera') {
git 'https://github.com/jboss-set/hera.git'
}
dir('harmonia') {
git branch: 'olympus', url: 'https://github.com/jboss-set/harmonia.git'
}
sh label: '', script: "mkdir -p ${env.WORKSPACE}/workdir"
script {
env.BUILD_SCRIPT = "${env.WORKSPACE}/hera/build-wrapper.sh"
}
echo "BUILD_COMMAND: ${env.BUILD_COMMAND}"
// Start container
sh label: '', script: "${env.WORKSPACE}/hera/hera.sh run"
}
}
}
stage ('Build') {
steps {
sh label: '', script: "${env.WORKSPACE}/hera/hera.sh job"
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'workdir', reportFiles: 'report.html', reportName: 'HTML Report', reportTitles: ''])
archiveArtifacts artifacts: '**/*', fingerprint: true, followSymlinks: false, onlyIfSuccessful: true
}
}
}
post {
always {
script {
try {
sh label: '', script: "${env.WORKSPACE}/hera/hera.sh stop"
} catch (err) {
echo "Error while deleting container: ${err}"
}
}
}
}
}