Skip to content

Commit b605edf

Browse files
committed
Jenkins: Fix printing cluster state on err in int test
Tries to complete what f76469b started. Fixes "docker: not found:" because the code is run inside the groovy container, where there is no docker binary.
1 parent f5f2793 commit b605edf

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Jenkinsfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,25 @@ node('high-cpu') {
115115
returnStdout: true
116116
).trim()
117117

118+
int ret=0
118119
new Docker(this).image(groovyImage)
119120
// Avoids errors ("unable to resolve class") probably due to missing HOME for container in JVM.
120121
.mountJenkinsUser()
121122
.inside("--network=${k3dNetwork}") {
122123
// removing m2 and grapes avoids issues where grapes primarily resolves local m2 and fails on missing versions
123124
sh "rm -rf .m2/"
124125
sh "rm -rf .groovy/grapes"
125-
int ret = sh(returnStatus: true,
126+
ret = sh(returnStatus: true,
126127
script: "groovy ./scripts/e2e.groovy --url http://${k3dAddress}:9090 --user admin --password admin --writeFailedLog --fail --retry 2")
127-
128-
if (ret > 0 ) {
129-
if (fileExists('playground-logs-of-failed-jobs')) {
130-
archiveArtifacts artifacts: 'playground-logs-of-failed-jobs/*.log'
131-
}
132-
unstable "Integration tests failed, see logs appended to jobs and cluster status in logs"
133-
sh "docker exec -it k3d-${clusterName}-server-0 kubectl get all -A"
134-
}
135128
}
129+
130+
if (ret > 0 ) {
131+
if (fileExists('playground-logs-of-failed-jobs')) {
132+
archiveArtifacts artifacts: 'playground-logs-of-failed-jobs/*.log'
133+
}
134+
unstable "Integration tests failed, see logs appended to jobs and cluster status in logs"
135+
sh "docker exec k3d-${clusterName}-server-0 kubectl get all -A"
136+
}
136137
}
137138

138139
stage('Push image') {

0 commit comments

Comments
 (0)