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

More flexible install from template feature #5404

Open
softprops opened this issue Oct 19, 2018 · 6 comments
Open

More flexible install from template feature #5404

softprops opened this issue Oct 19, 2018 · 6 comments

Comments

@softprops
Copy link
Contributor

This is a Feature Proposal

Description

For feature proposals:

  • What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us.

I use serverless install with a custom template alot. I find the parameterization of just the name of the service.

I would like a way to drive more parameterization so that I could have less manual replacement to do after the template is cloned.

  • If there is additional config how would it look

I propose some form of metadata file that would exist in the remote template that serverless could read in, prompt users on install for values, the traverse the files in the local template and apply those values where templated with placeholders.

This would be a relatively big ( but nice ) change to how templates are installed because the single name parameter is replaced with a hardcoded regex in a hard coded file. This feature would need something a bit more appropriate for placeholder style templating.

Additional Data

  • Serverless Framework Version you're using:
  • Operating System:
  • Stack Trace:
  • Provider Error messages:
@softprops
Copy link
Contributor Author

While most ideas for features for serverless can be prototyped and proven out as a plugins, this one's a bit more sticky as it not a plugin that you install and run inside a project but one that creates a project.

@colonelpopcorn
Copy link

Is this sort of like a mvn archetype or a yeoman generator feature? I'd really like that, too. Either way, the CLI could use some loving to get it up to par with other project creation CLIs.

@metaskills
Copy link

Coming from AWS SAM which has Cookiecutter support (https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-customizing-starter-pipelines.html) I can say it really helps to DX and internal tool adoption with a feature like this. The project name is likely the most useful and could be dynamic applied to tags, package name, etc.

@metaskills
Copy link

I have learned that since the name of the service is parameterized that you can use something like ${self:service} in other places within your serverless.yml file.

@pgrzesik
Copy link
Contributor

pgrzesik commented May 9, 2022

Hey @metaskills, thanks a lot for feedback here. How would you imagine supporting something like that, were you thinking about having some kind of generic support for templates that can be filled during project setup, Cookiecutter-style? I'm wondering how much of it should be a responsibility of the Framework (currently it's possible to substitute service when setting up a new project via serverless) and how much can be handled by generic project generator tools such as Cookiecutter or Yeoman

@metaskills
Copy link

How would you imagine supporting something like that

Thanks for asking. I'm thinking the service is likely the right amount to take on in the Serverless Framework. Using Yeoman would be the DX tool of choice if others need to go further but should IMO not be in this tooling. Curious what others think too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants