forked from tutao/tutanota
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OpenSSL.Jenkinsfile
84 lines (75 loc) · 2.21 KB
/
OpenSSL.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
pipeline {
environment {
OPENSSL_VERSION="1.1.1"
OPENSSL_BRANCH='OpenSSL_1_1_1-stable'
// These options are all in service of reducing the total size of the binary by excluding things we don't need
// You can check `INSTALL` in the OpenSSL repo to find information about all of these options
CONFIGURE_PARAMS= "no-aria no-bf no-blake2 no-camellia no-cast no-chacha no-cmac \
no-des no-dh no-dsa no-ecdh no-ecdsa no-idea no-md4 no-mdc2 \
no-ocb no-poly1305 no-rc2 no-rc4 no-rmd160 no-scrypt no-seed \
no-siphash no-sm2 no-sm3 no-sm4 no-whirlpool \
no-engine no-err no-sock no-hw"
}
agent {
label 'master'
}
stages {
stage('build') {
parallel {
stage('build linux') {
agent {
label 'linux'
}
steps {
buildOpenssl(platform: "linux")
}
}
stage('build mac') {
agent {
label 'mac'
}
steps {
buildOpenssl(platform: "mac")
}
}
}
}
stage('publish to nexus') {
steps {
script {
publish("linux")
publish("mac")
}
}
}
}
}
def buildOpenssl(Map params) {
checkout changelog: false,
poll: false,
scm: [
$class: 'GitSCM', branches: [[name: '*/master']],
extensions: [],
userRemoteConfigs: [[url: 'git://git.openssl.org/openssl.git']]
]
script {
sh "git checkout ${OPENSSL_BRANCH}"
sh "./config ${CONFIGURE_PARAMS}"
sh "make build_generated && make libcrypto.a"
sh "mv libcrypto.a libcrypto-${params.platform}.a"
stash includes: "libcrypto-${params.platform}.a", name: "libcrypto-${params.platform}"
}
}
def publish(String platform) {
unstash "libcrypto-${platform}"
script {
def util = load "jenkins-lib/util.groovy"
util.publishToNexus(
groupId: "lib",
artifactId: "libcrypto",
version: "${OPENSSL_VERSION}-${platform}",
assetFilePath: "${WORKSPACE}/libcrypto-${platform}.a",
fileExtension: 'a'
)
}
}