-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Simplify built-in quickstarts to a simple hello world #849
Changes from 38 commits
0163474
d53c02d
927d438
48fc9b6
b65bb11
c539824
d562ff8
97210ec
2a3f7d5
022b827
777fbef
a9323d4
b8cfc19
840e662
72208d9
0c6abaa
68e72c9
1caa66d
667e265
80c68f3
e75f808
012168e
1b5757f
7648247
5b91fc4
6c5a656
a9ab5a4
89f2e40
8340bb5
dd1d16f
14cb8f5
58a4f3a
f02109e
a153a30
f13ef65
348ef5b
aeaf413
d61e3e8
e685a94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,13 +77,34 @@ def do_cli(ctx, location, runtime, output_dir, name, no_input): | |
LOG.debug("Init command") | ||
click.secho("[+] Initializing project structure...", fg="green") | ||
|
||
no_build_msg = """ | ||
Project generated: {output_dir}/{name} | ||
|
||
Steps you can take next within the project folder | ||
=================================================== | ||
[*] Invoke Function: sam local invoke HelloWorldFunction --event event.json | ||
[*] Start API Gateway locally: sam local start-api | ||
""".format(output_dir=output_dir, name=name) | ||
|
||
build_msg = """ | ||
Project generated: {output_dir}/{name} | ||
|
||
Steps you can take next within the project folder | ||
=================================================== | ||
[*] Install dependencies | ||
[*] Invoke Function: sam local invoke HelloWorldFunction --event event.json | ||
[*] Start API Gateway locally: sam local start-api | ||
""".format(output_dir=output_dir, name=name) | ||
|
||
no_build_step_required = ( | ||
"python", "python3.7", "python3.6", "python2.7", "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "ruby2.5") | ||
next_step_msg = no_build_msg if runtime in no_build_step_required else build_msg | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if a custom template takes in a the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what you mean by a custom template takes in 'a in the --runtime arg' -- This is a quick workaround until sam build fully supports all runtimes so the message will remain consistent and this will be deleted, though the workaround is flawed in the sense of as no_build_step_required = (
"python", "python3.7", "python3.6", "python2.7", "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "ruby2.5")
next_step_msg = no_build_msg if runtime in no_build_step_required else build_msg
What would you suggest instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. I was getting two PRs mixed up, where I thought we were passing runtime to cookiecutter examples that are passed to |
||
|
||
try: | ||
generate_project(location, runtime, output_dir, name, no_input) | ||
# Custom templates can implement their own visual cues so let's not repeat the message | ||
if not location: | ||
click.secho( | ||
"[SUCCESS] - Read {name}/README.md for further instructions on how to proceed" | ||
.format(name=name), bold=True) | ||
click.secho(next_step_msg, bold=True) | ||
click.secho("Read {name}/README.md for further instructions\n".format(name=name), bold=True) | ||
click.secho("[*] Project initialization is now complete", fg="green") | ||
except GenerateProjectFailedError as e: | ||
raise UserException(str(e)) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,20 @@ | ||
# Cookiecutter SAM for Node Lambda functions | ||
# Cookiecutter NodeJS Hello-world for SAM based Serverless App | ||
|
||
This is a [Cookiecutter](https://github.com/audreyr/cookiecutter) template to create a Serverless Hello World App based on Serverless Application Model (SAM) and NodeJS. | ||
|
||
It is important to note that you should not try to `git clone` this project but use `cookiecutter` CLI instead as ``{{cookiecutter.project_name}}`` will be rendered based on your input and therefore all variables and files will be rendered properly. | ||
A cookiecutter template to create a NodeJS Hello world boilerplate using [Serverless Application Model (SAM)](https://github.com/awslabs/serverless-application-model). | ||
|
||
## Requirements | ||
|
||
Install `cookiecutter` command line: | ||
|
||
**Pip users**: | ||
|
||
* `pip install cookiecutter` | ||
|
||
**Homebrew users**: | ||
|
||
* `brew install cookiecutter` | ||
|
||
**Windows or Pipenv users**: | ||
|
||
* `pipenv install cookiecutter` | ||
|
||
**NOTE**: [`Pipenv`](https://github.com/pypa/pipenv) is the new and recommended Python packaging tool that works across multiple platforms and makes Windows a first-class citizen. | ||
* [AWS SAM CLI](https://github.com/awslabs/aws-sam-cli) | ||
|
||
## Usage | ||
|
||
Generate a new SAM based Serverless App: `cookiecutter gh:aws-samples/cookiecutter-aws-sam-hello-nodejs`. | ||
|
||
You'll be prompted a few questions to help this cookiecutter template to scaffold this project and after its completed you should see a new folder at your current path with the name of the project you gave as input. | ||
Generate a boilerplate template in your current project directory using the following syntax: | ||
|
||
**NOTE**: After you understand how cookiecutter works (cookiecutter.json, mainly), you can fork this repo and apply your own mechanisms to accelerate your development process and this can be followed for any programming language and OS. | ||
* **NodeJS 8**: `sam init --runtime nodejs8.10` | ||
|
||
> **NOTE**: ``--name`` allows you to specify a different project folder name (`sam-app` is the default) | ||
|
||
# Credits | ||
|
||
* This project has been generated with [Cookiecutter](https://github.com/audreyr/cookiecutter) | ||
|
||
|
||
License | ||
------- | ||
|
||
This project is licensed under the terms of the [MIT License with no attribution](/LICENSE) |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lambda has moved nodejs4.3 to depreciated, meaning creating and updating functions is no longer allows/supported. Can we match that expectation here and remove creation of Nodejs.4.3 functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, done!