forked from pasdoc/pasdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
149 lines (146 loc) · 4.29 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/* -*- mode: groovy -*-
Configure how to run our job in Jenkins.
See https://castle-engine.io/cloud_builds_jenkins .
While PasDoc doesn't use Castle Game Engine,
but it uses CGE Jenkins infrastructure on https://jenkins.castle-engine.io/ ,
including a Docker image that contains various versions of FPC.
The resulting binaries are available on
https://pasdoc.github.io/DevelopmentSnapshots .
*/
pipeline {
agent none /* each stage has different agent */
stages {
/* Build for each platform in parallel.
See https://stackoverflow.com/questions/43913698/jenkinsfile-parallel-directive
https://www.jenkins.io/blog/2017/09/25/declarative-1/
for parallel syntax. */
stage('Run parallel builds') {
parallel {
stage('Linux stage') {
agent {
docker {
image 'kambi/castle-engine-cloud-builds-tools:cge-none'
}
}
stages {
stage('Test') {
steps {
sh 'source /usr/local/fpclazarus/bin/setup.sh default && make'
sh 'source /usr/local/fpclazarus/bin/setup.sh default && make tests'
}
}
stage('Clean') {
steps {
sh 'rm -f pasdoc-*.tar.gz pasdoc-*.zip'
sh 'make clean'
}
}
/* We don't need to package sources anymore.
GIT tag is enough, and GitHub makes a zip from it anyway.
stage('Package sources') {
steps {
sh 'make dist-src'
}
}
*/
stage('Build Linux/x86_64') {
steps {
sh 'make dist-linux-x86_64'
}
}
stage('Build Windows/i386') {
steps {
sh 'make dist-win32'
}
}
stage('Build Windows/x86_64') {
steps {
sh 'make dist-win64'
}
}
stage('Archiving') {
steps {
archiveArtifacts artifacts: 'pasdoc-*.tar.gz,pasdoc-*.zip'
}
}
}
}
stage('Raspberry Pi') {
agent {
label 'raspberry-pi-cge-builder'
}
stages {
stage('Clean RaspberryPi') {
steps {
sh 'rm -f pasdoc-*.tar.gz pasdoc-*.zip'
sh 'make clean'
}
}
stage('Test RaspberryPi') {
steps {
sh 'make'
sh 'make tests'
}
}
stage('Build RaspberryPi') {
steps {
sh 'make dist-linux-arm'
}
}
stage('Archiving RaspberryPi') {
steps {
archiveArtifacts artifacts: 'pasdoc-*.tar.gz,pasdoc-*.zip'
}
}
}
}
stage('macOS') {
agent {
label 'mac-cge-builder'
}
stages {
stage('Clean macOS') {
steps {
sh 'rm -f pasdoc-*.tar.gz pasdoc-*.zip'
sh 'make clean'
}
}
stage('Test macOS') {
steps {
sh 'make'
sh 'make tests'
}
}
stage('Build macOS') {
steps {
sh 'make dist-darwin-x86_64'
}
}
stage('Archiving macOS') {
steps {
archiveArtifacts artifacts: 'pasdoc-*.tar.gz,pasdoc-*.zip'
}
}
}
}
}
}
}
post {
regression {
mail to: '[email protected]',
subject: "[jenkins] Build started failing: ${currentBuild.fullDisplayName}",
body: "See the build details on ${env.BUILD_URL}"
}
failure {
mail to: '[email protected]',
subject: "[jenkins] Build failed: ${currentBuild.fullDisplayName}",
body: "See the build details on ${env.BUILD_URL}"
}
fixed {
mail to: '[email protected]',
subject: "[jenkins] Build is again successfull: ${currentBuild.fullDisplayName}",
body: "See the build details on ${env.BUILD_URL}"
}
}
}