-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
119 lines (114 loc) · 4.03 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
void Clean() {
dir("submodules") {
deleteDir()
writeFile file:'dummy', text:'' // Creates the directory
}
dir("release") {
deleteDir()
writeFile file:'dummy', text:'' // Creates the directory
}
}
void Build() {
checkout scm
dir("release") {
sh 'cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release'
sh 'make'
}
}
void Test() {
dir("release") {
sh './application/main'
}
}
pipeline {
agent none
stages {
stage('Initialization') {
parallel {
stage('Linux') {
agent {
label 'Linux'
}
stages {
stage('Clean on Linux') {
steps {
Clean()
}
}
stage('Build on Linux') {
steps {
Build()
}
}
stage('Test & Release on Linux') {
steps {
Test()
dir("release") {
sh 'mv application/main raplayer-linux-x86_64'
archiveArtifacts artifacts: 'raplayer-linux-x86_64', fingerprint: true
}
}
}
}
}
stage('macOS') {
agent {
label 'macOS'
}
stages {
stage('Clean on macOS') {
steps {
Clean()
}
}
stage('Build on macOS') {
steps {
Build()
}
}
stage('Test & Release on macOS') {
steps {
Test()
dir("release") {
sh 'mv application/main raplayer-mac-x86_64'
archiveArtifacts artifacts: 'raplayer-mac-x86_64', fingerprint: true
}
}
}
}
}
stage('Windows') {
agent {
label 'Windows'
}
stages {
stage('Clean on Windows') {
steps {
Clean()
}
}
stage('Build on Windows') {
steps {
dir("release") {
bat 'cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release'
bat 'make'
}
}
}
stage('Test & Release on Windows') {
steps {
dir("release") {
bat 'application\\main.exe'
bat 'move application\\main.exe raplayer-win-x86_64.exe'
bat 'copy C:\\cygwin64\\bin\\cygwin1.dll cygwin1.dll'
script { zip zipFile: 'raplayer-win-x86_64.zip', archive: false, glob: 'cygwin1.dll, raplayer-win-x86_64.exe' }
archiveArtifacts artifacts: 'raplayer-win-x86_64.zip', fingerprint: true
}
}
}
}
}
}
}
}
}