You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our number of terragrunt projects is increasing and now the plugin is taking almost 5 minutes to generate the config for all the projects.
I have seen that i can use --preserve-workflows --preserve-projects so my idea to create a wrapper that iterates over the result of git diff and call terragrunt-atlantis-config with those flags set to true.
I would like to see how others are facing with the same problem and see some examples if possible.
Thanks in advance!
All the best
The text was updated successfully, but these errors were encountered:
Something like this should help. If I understood correctly, Atlantis does a shallow clone of the PR branch by default and you will not be able to use git diff there.
#!/bin/bash
# Get head branch
branch=$(git symbolic-ref --short HEAD)
# Login to GitHub
echo GH_TOKEN | gh auth login --with-token
echo "Determining what terragrunt modules have changed in this PR"
changed_modules=$(gh pr list --head $branch --json files --jq '.[].files[].path' \
| grep -E '*.hcl|*.yaml|*.json' | xargs dirname | uniq)
if [[ -z $changed_modules ]]; then
echo "No terragrunt modules have changed."
else
for module in $changed_modules; do
echo "Terragrunt module: $module contains changes"
echo "Generating terragrunt atlantis config for: $module"
terragrunt-atlantis-config generate --create-project-name --preserve-projects --filter $module \
--ignore-dependency-blocks --autoplan=true --automerge=true --output atlantis.yaml --parallel=false
done
fi
Hi all,
Our number of terragrunt projects is increasing and now the plugin is taking almost 5 minutes to generate the config for all the projects.
I have seen that i can use
--preserve-workflows --preserve-projects
so my idea to create a wrapper that iterates over the result ofgit diff
and callterragrunt-atlantis-config
with those flags set to true.I would like to see how others are facing with the same problem and see some examples if possible.
Thanks in advance!
All the best
The text was updated successfully, but these errors were encountered: