diff --git a/Jenkinsfile b/Jenkinsfile index ac54610..6f6ac54 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { apiVersion: v1 kind: Pod spec: - nodeSelector: {hardware: rpi5, kubernetes.io/arch: arm64, node-role.kubernetes.io/worker: "true"} + nodeSelector: {kubernetes.io/arch: arm64, node-role.kubernetes.io/worker: "true"} affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: @@ -485,15 +485,33 @@ PY post { always { script { - if (fileExists('build/junit-backend.xml') || fileExists('build/junit-frontend.xml')) { - try { - junit allowEmptyResults: true, testResults: 'build/junit-backend.xml,build/junit-frontend.xml' - } catch (Throwable err) { - echo "junit step unavailable: ${err.class.simpleName}" + try { + if (fileExists('build/junit-backend.xml') || fileExists('build/junit-frontend.xml')) { + try { + junit allowEmptyResults: true, testResults: 'build/junit-backend.xml,build/junit-frontend.xml' + } catch (Throwable err) { + echo "junit step unavailable: ${err.class.simpleName}" + } + } + } catch (Throwable err) { + if (err.class.simpleName == 'MissingContextVariableException') { + echo 'workspace unavailable; skipping junit publish' + } else { + throw err + } + } + } + script { + try { + archiveArtifacts artifacts: 'build/**', allowEmptyArchive: true, fingerprint: true + } catch (Throwable err) { + if (err.class.simpleName == 'MissingContextVariableException') { + echo 'workspace unavailable; skipping artifact archive' + } else { + throw err } } } - archiveArtifacts artifacts: 'build/**', allowEmptyArchive: true, fingerprint: true } } }