How do I prevent gruntwork pipelines from running in specific folders or modules?
Is there a supported way of skipping Gruntwork Pipeline runs to a specific account, folder, or module? For example if I add an account that I want to manage outside of pipelines it will try to run and error out since the new account has no ECS Deploy Runner. --- <ins datetime="2023-03-03T18:15:25Z"> <p><a href="https://support.gruntwork.io/hc/requests/109950">Tracked in ticket #109950</a></p> </ins>
If you're using the default setup you should have a script located at `_ci/scripts/deploy-infra.sh` It's responsible for detecting changes and deciding which deployer commands to run. You should be able to add a new condition to the `route` function to skip specific modules. By default this feature is used to exclude the `ecs-deploy-runner` from updating itself as shown below: ``` function route { local -r updated_folder="$1" # Add to this condition if you have other modules you do not want to manage with ECS deploy runner. if [[ "$updated_folder" == "." ]]; then echo "WARNING: A configuration in the repository root has changed. Because this could potentially impact many configurations, an operator must run a plan-all or apply-all manually in each account." # As of bash 3.2, do not use double quotes around regular expressions. elif [[ "$updated_folder" =~ ^.+/ecs-deploy-runner(/.+)?$ ]]; then echo "No action defined for changes to $updated_folder." elif [[ "$updated_folder" =~ ^_envcommon/mgmt/ecs-deploy-runner.hcl$ ]]; then echo "No action defined for changes to $updated_folder." else invoke_infrastructure_deployer "$@" fi } ``` For example, you might add the following elif statement to prevent running plan and apply on any folders including `my-excluded-module` ``` elif [[ "$updated_folder" =~ ^.+/my-excluded-module(/.+)?$ ]]; then echo "No action" ```