-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
91 lines (82 loc) · 3.79 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
// Copyright (c) 2004-2020 Microchip Technology Inc. and its subsidiaries.
// SPDX-License-Identifier: MIT
/*
Microchip is aware that some terminology used in this technical document is
antiquated and inappropriate. As a result of the complex nature of software
where seemingly simple changes have unpredictable, and often far-reaching
negative results on the software's functionality (requiring extensive retesting
and revalidation) we are unable to make the desired changes in all legacy
systems without compromising our product or our clients' products.
*/
properties([
[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '5', numToKeepStr: '20']],
[$class: 'GithubProjectProperty', projectUrlStr: 'https://bitbucket.microchip.com/scm/unge/sw-mepa.git'],
[$class: 'ThrottleJobProperty', categories: [], limitOneJobWithMatchingParams: false, maxConcurrentPerNode: 0, maxConcurrentTotal: 1, paramsToUseForLimit: '', throttleEnabled: true, throttleOption: 'project']
])
node('blademaster') {
try {
stage("SCM Checkout") {
checkout([
$class: 'GitSCM',
branches: scm.branches,
doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
extensions: scm.extensions + [[$class: 'CloneOption', noTags: false, reference: '/gitref/mepa.git', shallow: false]],
submoduleCfg: [],
userRemoteConfigs: scm.userRemoteConfigs
])
sh "git reset --hard; git clean -ffdx"
sh "git lfs fetch"
sh "git lfs checkout"
}
step([$class: 'GitHubSetCommitStatusBuilder', statusMessage: [content: 'Build in progress']])
currentBuild.result = 'SUCCESS'
try {
stage("Build") {
sh "dr ./.cmake/release.rb --internal-checks"
}
} catch (error) {
currentBuild.result = 'FAILURE'
throw error
} finally {
stage("Archiving results") {
try {
archive 'images/**'
archive 'release_ws/*.log'
} catch (error) {
currentBuild.result = 'FAILURE'
throw error
}
}
}
stage("Backwards compatibility") {
try {
sh "dr ./.cmake/backwards-compatibility-check.rb"
} catch (error) {
currentBuild.result = 'FAILURE'
throw error
}
}
} catch(error) {
} finally {
step([
$class: 'GitHubCommitStatusSetter',
errorHandlers: [[$class: 'ShallowAnyErrorHandler']],
statusResultSource: [
$class: 'ConditionalStatusResultSource',
results: [
[$class: 'BetterThanOrEqualBuildResult', result: 'SUCCESS', state: 'SUCCESS', message: currentBuild.description],
[$class: 'BetterThanOrEqualBuildResult', result: 'FAILURE', state: 'FAILURE', message: currentBuild.description],
[$class: 'AnyBuildResult', state: 'FAILURE', message: 'Loophole']
]
]
])
try {
// Prevent this step from making the whole thing fail by encapsulating
// it in a 'try' with an empty 'catch'
step([$class: 'Mailer', notifyEveryUnstableBuild: true,
recipients: emailextrecipients([[$class: 'CulpritsRecipientProvider'],
[$class: 'RequesterRecipientProvider']])])
} catch (Exception ex) {
}
}
}