This repository has been archived by the owner on Oct 13, 2021. It is now read-only.
forked from RedHat-MultiArch-QE/multiarch-ci-test-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
88 lines (82 loc) · 2.92 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
properties(
[
parameters(
[
string(
defaultValue: 'x86_64,ppc64le',
description: 'A comma separated list of architectures to run the test on. Valid values include [x86_64, ppc64le, aarch64, s390x].',
name: 'ARCHES'
),
string(
defaultValue: 'https://github.com/RedHat-MultiArch-QE/multiarch-ci-libraries',
description: 'Repo for shared libraries.',
name: 'LIBRARIES_REPO'
),
string(
defaultValue: 'v1.0',
description: 'Git reference to the branch or tag of shared libraries.',
name: 'LIBRARIES_REF'
),
string(
defaultValue: '',
description: 'Repo for tests to run. If left blank, the current repo is assumed (*note* this default will only work for multibranch pipelines).',
name: 'TEST_REPO'
),
string(
defaultValue: '',
description: 'Git reference to the branch or tag of the tests repo.',
name: 'TEST_REF'
),
string(
defaultValue: 'tests',
description: 'Directory containing tests to run. Should at least one of the follow: an ansible-playbooks directory containing one or more test directories each of which having a playbook.yml, a scripts directory containing one or more test directories each of which having a run-test.sh',
name: 'TEST_DIR'
),
string(
defaultValue: '',
description: 'Contains the CI_MESSAGE for a message bus triggered build.',
name: 'CI_MESSAGE'
)
]
)
]
)
library(
changelog: false,
identifier: "multiarch-ci-libraries@${params.LIBRARIES_REF}",
retriever: modernSCM([$class: 'GitSCMSource',remote: "${params.LIBRARIES_REPO}"])
)
List arches = params.ARCHES.tokenize(',')
def errorMessages = ''
def config = TestUtils.getProvisioningConfig(this)
TestUtils.runParallelMultiArchTest(
this,
arches,
config,
{ host ->
/*********************************************************/
/* TEST BODY */
/* @param host Provisioned host details. */
/*********************************************************/
stage ('Download Test Files') {
downloadTests()
}
stage ('Run Test') {
runTests(config, host)
}
stage ('Archive Test Output') {
archiveOutput()
}
/*****************************************************************/
/* END TEST BODY */
/* Do not edit beyond this point */
/*****************************************************************/
},
{ Exception exception, def host ->
def error = "Exception ${exception} occured on ${host.arch}\n"
errorMessages += error
if (host.arch.equals("x86_64") || host.arch.equals("ppc64le")) {
currentBuild.result = 'FAILURE'
}
}
)