telia-oss / concourse-tasks

Common concourse tasks.
MIT License
3 stars 5 forks source link

Concourse reports success eventhough the terraform plan ends with error #27

Closed georgpet closed 4 years ago

georgpet commented 5 years ago

Please check following build, tasks plan-terraform-stage & plan-terraform-prod

itsdalmo commented 5 years ago

I don't have access to your build logs on Concourse (not a member of your team). Could you paste the relevant parts here if it does not contain private information? (This is a public repository and this issue is readable by anyone on the internet).

georgpet commented 5 years ago

The terraform plan output ends with following error message:

------------------------------------------------------------------------

Error: Error running plan: 1 error(s) occurred:

* module.ecs-cluster.module.dashboard-lambda.aws_lambda_function.lambda: 1 error(s) occurred:

* module.ecs-cluster.module.dashboard-lambda.aws_lambda_function.lambda: file: open .terraform/modules/afa91fea658d091077f9c5cfdd411c10/lambda_services_dashboard.zip: no such file or directory in:

${base64sha256(file(var.filename))}
itsdalmo commented 5 years ago

And the exit code was zero (i.e. no error)?

Relevant code: https://github.com/telia-oss/concourse-tasks/blob/master/terraform/terraform.sh#L91

I believe the problem here is that we are not using set -eo pipefail in the script. Will create a PR to add -o pipefail as soon as I have time 👍

georgpet commented 5 years ago

Yeah, no error -> everything green