-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support Git Submodules #311
Comments
Yeah that looks good! Please push a PR. Can you also look into if there are any unintended consequences? |
We should version detect git though and make sure we use the right command for the right version. |
@osterman a more "backward compatible" approach to this would be:
|
The problem with this approach is we cannot detect changes automatically, which is why we implemented custom support for it in our fork. |
could you please elaborate how did you manage implement this? |
@tomer-1 we ended up having to compromise. Our change detects if a submodule folder is modified and then executes. We were not able to detect changes inside the submodule due to the current implementation relying on the files changed as returned by the github API and not the files changed using git calculus. |
@aknysh can add more details |
@osterman i understand you had to compromise for the changes in the modules, |
@tomer-1 did you have a chance to look at the PRs where we implement it? cloudposse-archives#11 @aknysh can answer any specific questions about these. |
@osterman HI, I am exploring atlantis to use, While the repo has submodules for terraform vars file, it does not checkout submodules. Wondering how to make it work. Thanks |
I'm blocked by this too. Can we add extra args for the git clone so that it can |
Does this work? @osterman was saying that that's not enough because the github api doesn't return the list of files changed in the submodule so Atlantis won't know that the files in the submodule have changed and it won't trigger a plan. |
Are there extra args so that we can configure git in our server config? So we can add |
No, you can't add extra args to the git clone command. |
@lkysow I figured this one out too. I added this to my plan workflow:
|
another submodule usecase to support is forcing a plan b/c of symlinks ... we have common terraform code IE. tfvars, in a directory that also happens to be a git submodule. We are able to check out the submodule with a custom workflow as described above. There are files in the submodule that are shared / accesses via a symlink in each respective directory. Of course the symlink doesn't change so there is nothing to trigger the plan. I'd be really awesome to be able to force a plan via GitHub regardless if Atlantis thinks there is a change or not. |
Is there any update on this one? |
@lkysow do you know how to make this work with a github app? any suggestions |
@mnhat3896 did you use a github app or your PAT to authenticate between atlantis and your github account on this test? |
@dgokcin Sorry for the response late. |
hmm. can i do this with a github app? I want to avoid using a PAT or anything personal. |
@dgokcin Even before you run the plan/init or submodule commands, you have to authenticate with Github and you can do that via a Github app too. Please check this for reference on how to authenticate using Github app. |
well, yes indeed, as @ganesh-katakam-T18451 said you have to authenticate with VCS. The thing I mentioned above about submodule. when you run |
@dgokcin
If I write gitconfig like that code, the request will go to https.
The contents of this file may vary depending on how you use git submodules. |
In case it's useful, when using git app with --write-git-creds, I found the following allows me to use git submodules:
|
For github apps, see also #4704 |
what
why
atlantis/server/events/working_dir.go
Line 113 in f057d6d
terragrunt
use-case
terraform-root-modules
@lkysow do you think this would work?
Technically, looks very easy to implement here and we'd be happy contribute the capability.
The text was updated successfully, but these errors were encountered: