-
Notifications
You must be signed in to change notification settings - Fork 37
/
Jenkinsfile
76 lines (76 loc) · 3.58 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
sh "docker run --rm -v /docker/gogs/jenkins/home'${env.WORKSPACE.substring(17,env.WORKSPACE.length())}':'/root' cutec/buildhost-lazarus-x64 bash /root/build.sh submodules"
}
}
stage ("Build") {
steps {
parallel (
"Windows" : {
sh "docker run --rm -v /docker/gogs/jenkins/home'${env.WORKSPACE.substring(17,env.WORKSPACE.length())}':'/root/promet' cutec/buildhost-lazarus-windows bash z:/root/promet/build.sh all"
},
"Linux-x64" : {
sh "docker run --rm -v /docker/gogs/jenkins/home'${env.WORKSPACE.substring(17,env.WORKSPACE.length())}':'/root' cutec/buildhost-lazarus-x64 bash /root/build.sh"
},
"Linux-x86" : {
sh "docker run --rm -v /docker/gogs/jenkins/home'${env.WORKSPACE.substring(17,env.WORKSPACE.length())}':'/root' cutec/buildhost-lazarus-i386 bash /root/build.sh"
},
"Linux-armhf" : {
script {
try {
sh "docker run --rm -v /docker/gogs/jenkins/home'${env.WORKSPACE.substring(17,env.WORKSPACE.length())}':'/root' -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static cutec/buildhost-lazarus-armhf bash /root/build.sh server"
}
catch (exc) {
echo 'Arm Build failed!'
currentBuild.result = 'SUCCESS'
}
}
echo currentBuild.result
}
)
}
}
stage('Upload') {
steps {
script {
try {
dir(env.WORKSPACE) {
sh "set +e"
sh "bash promet/setup/upload_builds.sh"
sh "docker run --rm -v /root/.prometerp:/root/.prometerp -v /docker/gogs/jenkins/home'${env.WORKSPACE.substring(17,env.WORKSPACE.length())}':'/root' cutec/buildhost-lazarus-x64 bash /root/promet/setup/change_wiki_alpha.sh"
sh "bash promet/setup/build_containers.sh"
}
}
catch (exc) {
echo 'Upload failed!'
currentBuild.result = 'SUCCESS'
}
}
echo currentBuild.result
}
}
}
post {
always {
sh 'rm -rf promet/output/*/*.compiled'
sh 'rm -rf promet/output/*/*.dbg'
sh 'rm -rf promet/output/*/*/*.compiled'
sh 'rm -rf promet/output/*/*/*.dbg'
sh 'rm -rf promet/output/*/*/*.o'
sh 'rm -rf promet/output/*/*/*.ppu'
sh 'rm -rf promet/output/*/*/*.a'
archiveArtifacts artifacts: "promet/output/", fingerprint: true
}
failure {
//cleanWs()
mail to: 'jenkins@chris.ullihome.de',
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
body: """<p>FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at "<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>"""
}
}
}