-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile.disabled
More file actions
116 lines (105 loc) · 4.12 KB
/
Copy pathJenkinsfile.disabled
File metadata and controls
116 lines (105 loc) · 4.12 KB
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
properties properties: [
[
$class: 'BuildDiscarderProperty',
strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30']
]
]
node('osx && ios') {
def contributors = null
def Utils
def buildLabel
currentBuild.result = "SUCCESS"
stage ('Checkout Source') {
deleteDir()
checkout scm
getUtils()
// load pipeline utility functions
Utils = load "utils/Utils.groovy"
buildLabel = Utils.&getBuildLabel()
}
stage ('Create Change Logs') {
sshagent(['38bf8b09-9e52-421a-a8ed-5280fcb921af']) {
dir('./SCM') {
sh '../utils/scmBuildDate > TIMESTAMP'
writeFile file: "TAG", text: buildLabel
writeFile file: "URL", text: env.BUILD_URL
writeFile file: "BRANCH", text: env.BRANCH_NAME
sh '../utils/scmBuildContributors > CONTRIBUTORS'
sh '../utils/scmBuildOnHookEmail > ONHOOK_EMAIL'
def htmlChangelog = Utils.&generateChangeLog(false)
def mdChangelog = Utils.&generateChangeLog(true)
currentBuild.description = htmlChangelog
writeFile file: "CHANGELOG.md", text: mdChangelog
}
}
}
try {
contributors = readFile './SCM/ONHOOK_EMAIL'
stage ('Capture Build Environment') {
sh 'env -u PWD -u HOME -u PATH -u \'BASH_FUNC_copy_reference_file()\' > SCM/build.env'
}
stage ('Notify Build Started') {
Utils.&sendOnHookEmail(contributors)
}
stage ('Build Parallel') {
stash name: 'Makefile', includes: 'Makefile,archive/**,patches/**'
parallel (
"armv7" : {
node('osx && ios') {
// Accept the license on first install and updates
Utils.&acceptXcodeLicense()
// clean workspace
deleteDir()
unstash 'Makefile'
sh 'make clean'
sh 'make ENABLE_BITCODE=YES BITCODE_GENERATION_MODE=bitcode ARCHS=armv7'
stash name: 'armv7', includes: '**/armv7/archive.framework/**'
}
},
"arm64" : {
node('osx && ios') {
// Accept the license on first install and updates
Utils.&acceptXcodeLicense()
// clean workspace
deleteDir()
unstash 'Makefile'
sh 'make clean'
sh 'make ENABLE_BITCODE=YES BITCODE_GENERATION_MODE=bitcode ARCHS=arm64'
stash name: 'arm64', includes: '**/arm64/archive.framework/**'
}
}
)
}
stage ('Assemble Framework') {
unstash 'armv7'
unstash 'arm64'
// Accept the license on first install and updates
Utils.&acceptXcodeLicense()
sh 'make ARCHS="armv7 arm64" bundle'
}
stage ('Archive Artifacts') {
// Archive the SCM logs, the framework directory
step([$class: 'ArtifactArchiver',
artifacts: 'SCM/**, archive.framework.tar.bz2',
fingerprint: true,
onlyIfSuccessful: true])
}
}
catch(err) {
currentBuild.result = "FAILURE"
Utils.&sendFailureEmail(contributors, err)
throw err
}
stage ('Notify Build Completion') {
Utils.&sendOffHookEmail(contributors)
}
}
def getUtils() {
// Load the SCM util scripts first
checkout([$class: 'GitSCM',
branches: [[name: "*/${env.BRANCH_NAME}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'utils']],
submoduleCfg: [],
userRemoteConfigs: [[url: 'git@github.com:Cogosense/JenkinsUtils.git', credentialsId: '38bf8b09-9e52-421a-a8ed-5280fcb921af']]])
}