Issues when destroying modules via the gruntworks pipeline #682
-
|
We're using the Gruntworks Ref arch, and the Gruntworks pipeline (and associated scripts) for deploying our infra, with GHA. We encounter this issue only when attempting to delete modules, and only under specific circumstances. To reproduce:
This is the message we get: To be clear, if no PR is merged before the pipeline finishes, it runs perfectly well. We're not totally sure what's going on, but we suspect the pipe is picking the latest commit in master as a reference when starting each fargate task. When a new commit is added while the pipe runs, it picks this one up, and it doesn't have any of the modules, as they were deleted in a previous commit. How can we fix this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
@umm0n this has been reported by another customer as well and we have an issue for it here https://github.com/gruntwork-io/terraform-aws-service-catalog/issues/1798 as well as an open PR for it here |
Beta Was this translation helpful? Give feedback.
-
|
Hi @umm0n, thanks for the report! We've done extensive testing for a fix for this. In short, we've made a change to calculate the source ref earlier in the process, to ensure that the ref used in the ecs-deploy-runner during delete operations will not change due to subsequent PR merges prior to the delete operation occuring. You will need to make this same change in the ci configuration for your CI tool of choice (e.g., GH Actions, Gitlab) in your repo. For example, if you're using GH Actions, you would need to modify We are working to update our examples in the service-catalog, but for now, you can see how we accomplished this, in the following PR: https://github.com/gruntwork-io/terraform-aws-service-catalog/pull/1799/files#diff-406976bb201d23780f59dab210db1c29210c5e32fa2e5fe08472236f4e8f611b |
Beta Was this translation helpful? Give feedback.
Hi @umm0n, thanks for the report!
We've done extensive testing for a fix for this. In short, we've made a change to calculate the source ref earlier in the process, to ensure that the ref used in the ecs-deploy-runner during delete operations will not change due to subsequent PR merges prior to the delete operation occuring.
You will need to make this same change in the ci configuration for your CI tool of choice (e.g., GH Actions, Gitlab) in your repo. For example, if you're using GH Actions, you would need to modify
infrastructure-live/.github/scripts/source-ref.sh.We are working to update our examples in the service-catalog, but for now, you can see how we accomplished this, in the fo…