Closed gmaghera closed 3 weeks ago
Hello, should be:
terragrunt scaffold github.com/gruntwork-io/terragrunt.git//test/fixtures/inputs git@github.com:gruntwork-io/terragrunt.git//test/fixtures/scaffold/external-template
I will update documentation
Thanks, @denis256!
That diff is so subtle, it took me a minute to see it.
@denis256 should this also work with local file paths? I've cloned the terragrunt repo
and tried to give it the local directory instead:
❯ terragrunt scaffold github.com/gruntwork-io/terragrunt.git//test/fixtures/inputs /Users/gmaghera/Workspaces/terragrunt/test/fixtures/scaffold/external-template
08:34:01.547 WARN The working directory . is not empty.
08:34:02.075 INFO Scaffolding a new Terragrunt module git::https://github.com/gruntwork-io/terragrunt.git//test/fixtures/inputs?ref=v0.68.5-beta2024102101 to .
fatal: '/Users/gmaghera/Workspaces/terragrunt/test/fixtures/scaffold/external-template' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
08:35:14.842 WARN Failed to execute git ls-remote --tags file://../../../../../../terragrunt/test/fixtures/scaffold/external-template in .
fatal: '../../../../../../terragrunt/test/fixtures/scaffold/external-template' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
exit status 128
08:35:14.842 WARN Failed to find last release tag for URL file://../../../../../../terragrunt/test/fixtures/scaffold/external-template, so will not add a ref param to the URL
08:35:14.843 INFO Using template from file://../../../../../../terragrunt/test/fixtures/scaffold/external-template
08:35:14.937 ERROR error downloading 'file://../../../../../../terragrunt/test/fixtures/scaffold/external-template': destination exists and is not a symlink
08:35:14.937 ERROR Unable to determine underlying exit code, so Terragrunt will exit with error code 1
This is what I tried initially, and it did not work, so I tried to use one of the examples from the docs. None of the examples in there show how to do this via file paths -- which I think would be really helpful for developing the custom boilerplate.
Do you have a trick for getting that to work?
Hi,
try to use //
in local path
terragrunt scaffold github.com/gruntwork-io/terragrunt.git//test/fixtures/inputs /projects/gruntwork/terragrunt-tests/scaffold/local//external-template
$ terragrunt scaffold github.com/gruntwork-io/terragrunt.git//test/fixtures/inputs /projects/gruntwork/terragrunt-tests/scaffold/local//external-template
[INFO] Getting version from tgenv-version-name
[INFO] TGENV_VERSION is 0.68.4
19:07:18.082 INFO Scaffolding a new Terragrunt module git::https://github.com/gruntwork-io/terragrunt.git//test/fixtures/inputs?ref=v0.68.5-beta2024102101 to .
fatal: '/projects/gruntwork/terragrunt-tests/scaffold/local' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
19:07:24.005 WARN Failed to find last release tag for URL file:///projects/gruntwork/terragrunt-tests/scaffold/local, so will not add a ref param to the URL
19:07:24.006 INFO Using template from file:///projects/gruntwork/terragrunt-tests/scaffold/local//external-template
19:07:24.007 INFO Running boilerplate generation to .
[boilerplate] 2024/10/23 19:07:24 Loading boilerplate config from /tmp/template2649612922/boilerplate.yml
[boilerplate] 2024/10/23 19:07:24 Loading boilerplate config from /tmp/template2649612922/boilerplate.yml
[boilerplate] 2024/10/23 19:07:24 Processing templates in /tmp/template2649612922 and outputting generated files to /projects/gruntwork/terragrunt-tests/scaffold/local/temp
[boilerplate] 2024/10/23 19:07:24 Skipping /tmp/template2649612922
[boilerplate] 2024/10/23 19:07:24 Skipping /tmp/template2649612922/boilerplate.yml
19:07:24.012 INFO Running fmt on generated code .
19:07:24.012 INFO Scaffolding completed
That works!
Thank you so much, @denis256.
Describe the bug
The exact use case stated in Terragrunt docs for scaffold using external template fails to run successfully.
Steps To Reproduce
terragrunt scaffold github.com/gruntwork-io/terragrunt.git//test/fixtures/inputs git@github.com/gruntwork-io/terragrunt.git//test/fixtures/scaffold/external-template
Expected behavior
As stated by the docs, "Scaffold new project using external template:" ... "# will be created: external-template.txt terragrunt.hcl , files from external template".
Nice to haves
Versions