Closed nichtraunzer closed 2 years ago
terraform apply throws exit code 1
TF_IN_AUTOMATION=1 TF_WORKSPACE="default" terraform apply -auto-approve -input=false -no-color tfplan || (echo "tf apply exit status $?").
Error: creating CloudFormation stack failed: AlreadyExistsException: Stack [stack-aws-quickstarter] already exists
tf apply exit status 1
Will verify exit status in Jenkins file. Also check what the @ in the makefile means https://github.com/opendevstack/ods-quickstarters/blob/3fa162e5eebca1f4b425fa67b899afa5b0f2d45e/inf-terraform-aws/files/Makefile#L82
When deploying a CloudFormation Stack with the QS, and a Stack with the same name exists already terraform raises an "AlreadyExistsException"
Error: creating CloudFormation stack failed: AlreadyExistsException: Stack [stack-aws-quickstarter] already exists
That behavior is expected and correct. But this error is not handled by Jenkins, because it still proceeds, calls the next stage (smoke) and finally fails in this stage. It seems that either the terraform apply does not recognize that as an error or the error handling inside Jenkins has an issue.Steps to reproduce the behavior:
Expected behavior Stack should stop in the deploy stage already
Affected version
Log Output Stage Deploy
Stage Smoke