From e2c9a33dd2cab891eda4ec8297dc1537e990bd24 Mon Sep 17 00:00:00 2001 From: "Wais,Erhard (IT INF) BIG-AT-V" Date: Thu, 14 Apr 2022 11:55:18 +0200 Subject: [PATCH] store artifact --- src/org/ods/component/InfrastructureStage.groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/org/ods/component/InfrastructureStage.groovy b/src/org/ods/component/InfrastructureStage.groovy index 18ebbe91e6..6e45eac197 100644 --- a/src/org/ods/component/InfrastructureStage.groovy +++ b/src/org/ods/component/InfrastructureStage.groovy @@ -56,6 +56,10 @@ class InfrastructureStage extends Stage { } if (runMakeStage("deploy", this.options.cloudProvider, environmentVars, tfBackendS3Key, tfVars['meta_environment'] as String) != 0) { + if (script.fileExists('errored.tfstate')) { + logger.warn ("WARN: Terraform could not write statefile. errored.tfstate will be saved as artifact.") + steps.archiveArtifacts(artifacts: 'errored.tfstate') + } script.error("IaC - Deploy stage failed!") } if (runMakeStage("deployment-test", this.options.cloudProvider,