-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
188 lines (181 loc) · 8.21 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
pipeline {
agent none
environment {
SOUNDCLOUD_CLIENT_ID = credentials('rustic-soundcloud-client-id')
SPOTIFY_CLIENT_ID = credentials('rustic-spotify-client-id')
SPOTIFY_CLIENT_SECRET = credentials('rustic-spotify-client-secret')
}
stages {
stage('Build') {
parallel {
stage('Linux x64') {
agent {
dockerfile {
filename '.jenkins/Dockerfile'
additionalBuildArgs '--pull'
args '-v /usr/share/jenkins/cache:/build_cache'
}
}
environment {
CARGO_HOME = '/build_cache/cargo'
}
stages {
stage('Test') {
steps {
sh 'cargo test --workspace'
//sh 'cargo tarpaulin -o Xml -v --workspace'
//cobertura coberturaReportFile: 'cobertura.xml'
}
}
stage('Build') {
steps {
sh 'cargo build --workspace --release --message-format json > cargo-build.json'
fileOperations([
folderCreateOperation('linux-x86_64'),
fileRenameOperation(destination: 'linux-x86_64/rustic', source: 'target/release/rustic'),
fileRenameOperation(destination: 'linux-x86_64/librustic_ffi_client.so', source: 'target/release/librustic_ffi_client.so'),
fileCopyOperation(targetLocation: 'linux-x86_64/extensions/', includes: 'target/release/*_extension.so', flattenFiles: true)
])
archiveArtifacts artifacts: 'linux-x86_64/**/*', fingerprint: true
//recordIssues failOnError: false, enabledForFailure: true, tool: cargo(pattern: 'cargo-build.json')
}
}
}
post {
always {
cleanWs()
}
}
}
stage('C Bindings') {
agent {
dockerfile {
filename '.jenkins/Dockerfile.nightly'
additionalBuildArgs '--pull'
args '-v /usr/share/jenkins/cache:/build_cache'
}
}
environment {
CARGO_HOME = '/build_cache/cargo'
}
stages {
stage('Build') {
steps {
sh 'cargo expand -p rustic-ffi-client > ffi-client.rs'
sh 'cbindgen -o bindings.h -c clients/ffi/cbindgen.toml ffi-client.rs'
archiveArtifacts artifacts: 'bindings.h', fingerprint: true
}
}
}
post {
always {
cleanWs()
}
}
}
stage('WebAssembly') {
agent {
dockerfile {
filename '.jenkins/Dockerfile.wasm'
additionalBuildArgs '--pull'
args '-v /usr/share/jenkins/cache:/build_cache'
}
}
stages {
stage('Build') {
steps {
sh 'clients/http/wasm/package.sh'
archiveArtifacts artifacts: 'clients/http/wasm/pkg/*.tgz', fingerprint: true
}
}
}
post {
always {
cleanWs()
}
}
}
stage('Windows x64') {
agent {
label "windows"
}
stages {
stage('Build') {
steps {
bat 'cargo build --release --no-default-features --features "http-frontend rodio-backend local-files-provider pocketcasts-provider soundcloud-provider youtube-provider"'
bat 'make extensions'
fileOperations([
folderCreateOperation('win32-x86_64'),
fileRenameOperation(destination: 'win32-x86_64/rustic.exe', source: 'target/release/rustic.exe'),
// fileRenameOperation(destination: 'win32-x86_64/librustic_ffi_client.dll', source: 'target/release/librustic_ffi_client.dll'),
fileCopyOperation(targetLocation: 'win32-x86_64/extensions/', includes: 'target/release/*_extension.dll', flattenFiles: true)
])
archiveArtifacts artifacts: 'win32-x86_64/**/*', fingerprint: true
}
}
}
// post {
// always {
// cleanWs()
// }
// }
}
stage('macOS x64') {
agent {
label "osx"
}
stages {
stage('Build') {
steps {
sh 'cargo build --bins --workspace --release'
sh 'make ffi-library'
sh 'make extensions'
fileOperations([
folderCreateOperation('osx-x86_64'),
fileRenameOperation(destination: 'osx-x86_64/rustic', source: 'target/release/rustic'),
fileRenameOperation(destination: 'osx-x86_64/librustic_ffi_client.dylib', source: 'target/release/librustic_ffi_client.dylib'),
fileCopyOperation(targetLocation: 'osx-x86_64/extensions/', includes: 'target/release/*_extension.dylib', flattenFiles: true)
])
archiveArtifacts artifacts: 'osx-x86_64/**/*', fingerprint: true
}
}
}
post {
always {
cleanWs()
}
}
}
stage('Docs') {
agent {
dockerfile {
filename '.jenkins/Dockerfile'
additionalBuildArgs '--pull'
args '-v /usr/share/jenkins/cache:/build_cache'
}
}
environment {
CARGO_HOME = '/build_cache/cargo'
}
when {
branch 'master'
}
steps {
sh 'cargo doc --workspace --no-deps --exclude rustic-wasm-http-client'
publishHTML target: [
reportDir : 'target/doc',
reportFiles: 'rustic/index.html',
reportName : 'Documentation',
keepAll : false
]
}
post {
always {
cleanWs()
}
}
}
}
}
}
}