forked from nsai1/dai-ds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
units.pipeline.groovy
51 lines (44 loc) · 2.13 KB
/
units.pipeline.groovy
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
// Copyright (C) 2019-2020 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
pipeline {
agent none
parameters {
booleanParam(name: 'QUICK_BUILD', defaultValue: false,
description: 'Speeds up build by only performing a partial gradle clean')
}
stages {
stage('Unit') {
agent { label 'Nightly-Build' }
steps {
lastChanges format: 'LINE', matchWordsThreshold: '0.25', matching: 'NONE',
matchingMaxComparisons: '1000', showFiles: true, since: 'PREVIOUS_REVISION',
specificBuild: '', specificRevision: '', synchronisedScroll: true, vcsDir: ''
script {
sh 'rm -rf build/distributions'
utilities.FixFilesPermission()
if ( "${params.QUICK_BUILD}" == 'true' ) {
echo '*** This is a QUICK build'
utilities.InvokeGradle(":inventory:clean")
} else {
echo '*** This is a CLEAN build'
utilities.InvokeGradle("clean")
}
utilities.InvokeGradle("build || true")
jacoco classPattern: '**/classes/java/main/com/intel/'
junit '**/test-results/**/*.xml'
// check to see if the distribution folder is created
sh 'ls build/distributions'
}
sh 'rm -f *.zip'
zip archive: true, dir: '', glob: '**/build/jacoco/test.exec', zipFile: 'unit-test-coverage.zip'
zip archive: true, dir: '', glob: '**/main/**/*.java', zipFile: 'src.zip'
zip archive: true, dir: '', glob: '**/build/classes/java/main/**/*.class', zipFile: 'classes.zip'
zip archive: true, dir: 'inventory_api/src/test/resources/data', glob: '', zipFile: 'hwInvData.zip'
zip archive: true, dir: '', glob: '**/test-results/test/*.xml', zipFile: 'unit-test-results.zip'
archiveArtifacts 'build/distributions/**, build/reports/**'
}
}
}
}