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

change git root directory 'default' for actual repository name #2616

Open
juanidufourc opened this issue Oct 24, 2022 · 1 comment
Open

change git root directory 'default' for actual repository name #2616

juanidufourc opened this issue Oct 24, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@juanidufourc
Copy link

juanidufourc commented Oct 24, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

Hi, i’m looking for workarounds or suggestions for this problem.

Currently i’m using atlantis with terragrunt as the documentation explains (https://www.runatlantis.io/docs/custom-workflows.html#terragrunt). And I’m having an issue using get_repo_root() terragrunt built-in fuction due to way that atlantis use a repository structure folder to execute a plan.

In my terragrunt file I am using the following terragrunt built-in-function get_repo_root() for my terraform remote state and resources. In my local this returns the git repository name (e.g, project-example) but when I am using atlantis this returns default.

The path of my terragrunt file in atlantis is /atlantis-data/repos/my-company/project-example/16/default/dev/ and the git root directory is located in the default directory because atlantis use a different way to clone the repository adding {$pull_request_number}+{$workflow} after the repository name

Is there any way that my git root directory have the same name as the repository or can I rename that default directory so i can keep using the built-in-function get_repo_root(). Maybe i can change the way in which atlantis clone the pull_requests events and just give something like that ’/atlantis-data/repos/my-company/project-example/dev/` ?

Currently i workarounded the issue using the following built-in-function {element(split("/" ,get_terragrunt_dir()),4)} and that returns me the repository name project-example.

But i want to hear for a better solutions

Reproduction Steps

Check that when atlantis "clones" a git repository the git root directory doesn't have the same name of the repository instead it is indeed default

Logs

Environment details

Additional Context

@juanidufourc juanidufourc added the bug Something isn't working label Oct 24, 2022
@benjy44
Copy link

benjy44 commented Dec 8, 2023

for people still looking for a solution, I've added an ugly workaround here transcend-io/terragrunt-atlantis-config#258

This can be worked around by setting the workspace name to the name of the repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants