Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terragrunt generation: gitroot not prepended to digger project #1298

Merged
merged 4 commits into from
Mar 25, 2024

Conversation

motatoes
Copy link
Contributor

@motatoes motatoes commented Mar 25, 2024

Bug fix for: gitRoot parameter doesn’t map to the right path with discovered projects because it only uses the initial terragrunt.hcl as the root of directory, we need to prepend the gitRoot parameter in this case.

Example in this folder structure:

# tree
| - cloud
|.       - projectA
|.       - projectB
|.       - projectC
|.       - projectDTerragrunt
|.              - prod
|.              - nonprod
# digger.yml
generate_projects:
  terragrunt_parsing:
    parallel: true
    createProjectName: true
    createWorkspace: false
    defaultWorkflow: gcp_terragrunt
    ignoreDependencyBlocks: false
    ignoreParentTerragrunt: false
    gitRoot: cloud/projectDTerragrunt

The corresponding digger projects generated are: prod/ and nonprod. Whereas they should have been: cloud/projectDTerragrunt/prod and cloud/projectDTerragrunt/nonprod

In this fix we check for the existense of a gitRoot parameter and prepend it to generated digger projects.

Tested to fix in: https://github.com/diggerhq/demo-terragrunt-backendless-nested/actions/runs/8419854091

@motatoes motatoes changed the title Fix/gitroot not prepended to digger project terragrunt generation: gitroot not prepended to digger project Mar 25, 2024
@motatoes motatoes merged commit 94936b7 into develop Mar 25, 2024
7 checks passed
ben-of-codecraft pushed a commit to ben-of-codecraft/digger that referenced this pull request May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants