-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile.internal
More file actions
78 lines (72 loc) · 2.44 KB
/
Jenkinsfile.internal
File metadata and controls
78 lines (72 loc) · 2.44 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
/*
=============
Prerequisites
=============
* Global environment variables set:
- EMAIL_RECIPIENTS
- TG_AUTH_KEY
- ET_V1_VERSION
- ET_V2_VERSION
- TG_VERSION
* Jenkins plugins installed:
- https://plugins.jenkins.io/timestamper
- https://plugins.jenkins.io/gradle/
*/
@Library(['tracetronic-jenkins-lib', 'internal-cxs-jenkins-lib']) _
pipeline {
options {
buildDiscarder(logRotator(daysToKeepStr: '14'))
timestamps()
}
agent {
label 'master'
}
environment {
authKey = credentials('TG_authkey_test_report_upload')
pipeline_report_dir = "report2TG/build-$env.BUILD_NUMBER"
}
stages {
stage('Run Parallel') {
failFast false
parallel {
stage('System Tests') {
// The needed artifact is only built for main and pull requests -> skip this job otherwise
when { branch pattern: "PR-\\d+|main", comparator: "REGEXP"}
steps {
build job: '../systemTests', parameters: [string(name: 'artifactName', value: "${JOB_BASE_NAME}"), string(name: 'commitHash', value: "${GIT_COMMIT}")]
}
}
stage('Container Tests') {
agent {
label 'docker'
}
stages {
stage('Prepare Resources') {
steps {
copyArtifacts fingerprintArtifacts: true, projectName: '../prepareContainerTestData', selector: lastSuccessful()
}
}
stage('Run Container Tests') {
steps {
cmd '"./gradlew" clean containerTest -Dspock.skip.sandbox=false'
}
}
}
}
}
}
}
post {
always {
dir("${pipeline_report_dir}") {
pipeline2ATX(true)
}
uploadJson2TG("${TESTGUIDE_url}", "${authKey}", "${TESTGUIDE_projectID}", "${pipeline_report_dir}/**", '')
}
unsuccessful {
mail to: "${env.EMAIL_RECIPIENTS}",
subject: "${JOB_NAME} - Build #${BUILD_NUMBER} - ${currentBuild.currentResult}",
body: "Check console output at ${BUILD_URL} to view the results."
}
}
}