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

feat(cli): support --template urls with file:// protocol #3657

Closed
wants to merge 1 commit into from

Conversation

icholy
Copy link
Contributor

@icholy icholy commented Jun 20, 2024

Related issue

Fixes #3656

Description

Update the --template flag to support file:// URIs for using local template files.

Example

cdktf init --template file://../my-template.zip

Checklist

  • I have updated the PR title to match CDKTF's style guide
  • I have run the linter on my code locally
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation if applicable
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works if applicable
  • New and existing unit tests pass locally with my changes

Copy link

hashicorp-cla-app bot commented Jun 20, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@icholy icholy marked this pull request as ready for review June 20, 2024 17:22
@icholy icholy requested a review from a team as a code owner June 20, 2024 17:22
@icholy icholy requested review from mutahhir and DanielMSchmidt and removed request for a team June 20, 2024 17:22
@icholy icholy marked this pull request as draft June 20, 2024 17:36
@icholy icholy marked this pull request as ready for review June 20, 2024 17:39
Copy link
Contributor

Hi there! 👋 We haven't heard from you in 60 days and would like to know if you're still working on this or need help. If we don't hear from you before then, I'll auto-close this PR in 30 days.

@github-actions github-actions bot added the stale An issue or pull request that has not been updated in a very long time label Aug 20, 2024
@icholy
Copy link
Contributor Author

icholy commented Aug 20, 2024

Still waiting for comment.

@github-actions github-actions bot removed the stale An issue or pull request that has not been updated in a very long time label Aug 21, 2024
Copy link
Collaborator

@jsteinich jsteinich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks like it will work to me.

@icholy
Copy link
Contributor Author

icholy commented Oct 20, 2024

After some real-life experience with this, what I actually want to do is point it at a template directory. Having the template as a zip committed to the repo is pretty clunky. Also, the way I'm using the file:// scheme is not correct. file:// URIs do not support relative paths.

In light of this, I would like to change the design to work like this:

  • If the template string is an exact match to a built-in template, use that.
  • If the template string starts with http(s):// download the zip.
  • Otherwise treat it like a local directory.

@icholy icholy closed this Oct 20, 2024
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cdktf-cli: support local --template files
2 participants