1
0
mirror of https://github.com/firstBitMarksistskaya/jenkins-lib.git synced 2024-12-13 11:27:08 +02:00

Безопасный unstash результатов

This commit is contained in:
Nikita Gryzlov 2020-10-21 16:34:56 +03:00
parent fa6f9eadfc
commit 6e620f3336
No known key found for this signature in database
GPG Key ID: C1EAE411FEF0BF2F

View File

@ -10,17 +10,19 @@ import ru.pulsar.jenkins.library.utils.Logger
class PublishAllure implements Serializable {
private final JobConfiguration config;
private IStepExecutor steps;
PublishAllure(JobConfiguration config) {
this.config = config
}
def run() {
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor()
steps = ContextRegistry.getContext().getStepExecutor()
Logger.printLocation()
steps.unstash('init-allure')
safeUnstash('init-allure')
safeUnstash('bdd-allure')
def env = steps.env();
@ -42,4 +44,11 @@ class PublishAllure implements Serializable {
steps.allure(results)
}
private void safeUnstash(String stashName) {
try {
steps.unstash(stashName)
} catch (Exception ex) {
Logger.println("Can't unstash $stashName")
}
}
}