-
Notifications
You must be signed in to change notification settings - Fork 12
/
Jenkinsfile
executable file
·94 lines (94 loc) · 2.61 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
pipeline {
agent {
docker {
image 'scssubstratee/substratee_dev:18.04-2.9.1-1.1.2'
args '''
-u root
--privileged
'''
}
}
options {
timeout(time: 2, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '14'))
}
stages {
stage('rustup') {
steps {
sh './ci/install_rust.sh'
}
}
stage('Build') {
steps {
sh 'cargo build --release 2>&1 | tee build_release.log'
sh 'cargo build 2>&1 | tee build_debug.log'
}
}
stage('Archive build output') {
steps {
archiveArtifacts artifacts: '**/integritee-node', caseSensitive: false, fingerprint: true, onlyIfSuccessful: true
}
}
stage('Test') {
steps {
sh 'BUILD_DUMMY_WASM_BINARY=1 cargo test --all 2>&1 | tee test.log'
}
}
// running clippy doesn't actually make sense here, as it's 99% upstream code.
// however, right now it didn't take much to make it pass
stage('Clippy') {
steps {
sh 'cargo clean'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'cargo clippy 2>&1 | tee clippy_debug.log'
}
}
}
// NEVER!!! run cargo fmt! This is 99% upstream code and we need easy-rebase!
stage('Results') {
steps {
recordIssues(
aggregatingResults: true,
enabledForFailure: true,
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]],
tools: [
cargo(
pattern: 'build.log',
reportEncoding: 'UTF-8'
),
groovyScript(
parserId:'clippy-warnings',
pattern: 'clippy.log',
reportEncoding: 'UTF-8'
),
groovyScript(
parserId:'clippy-errors',
pattern: 'clippy.log',
reportEncoding: 'UTF-8'
)
]
)
// catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
// sh './ci/check_fmt_log.sh'
// }
}
}
stage('Archive logs') {
steps {
archiveArtifacts artifacts: '*.log', caseSensitive: false, fingerprint: true, onlyIfSuccessful: true
}
}
}
post {
unsuccessful {
emailext (
subject: "Jenkins Build '${env.JOB_NAME} [${env.BUILD_NUMBER}]' is ${currentBuild.currentResult}",
body: "${env.JOB_NAME} build ${env.BUILD_NUMBER} is ${currentBuild.currentResult}\n\nMore info at: ${env.BUILD_URL}",
to: "${env.RECIPIENTS_SUBSTRATEE}"
)
}
always {
cleanWs()
}
}
}