To submit a new extension, or to make changes to existing code, follow the instructions below.
- local: Your local copy of the forked repository.
- origin: Your forked, remote copy of the original repository.
- upstream: The original, remote serverless-coffee repository.
Fork and Clone the serverlesspresso repo.
-
Fork the original serverlesspresso repo to create a copy of the repo in your own GitHub account: https://github.com/aws-samples/serverless-coffee
-
Clone your copy of the repo to download it locally:
git clone https://github.com/{your-github-username}/serverless-coffee.git
-
Change into the new local directory:
cd serverless-coffee
-
Add the original serverless-coffee repo as another remote repo called "upstream":
git remote add upstream https://github.com/aws-samples/serverless-coffee
-
For verification, display the remote repos:
git remote -v
The output should look like this:
origin https://github.com/{your-github-username}/serverless-coffee.git (fetch) origin https://github.com/{your-github-username}/serverless-coffee.git (push) upstream https://github.com/aws-samples/serverless-coffee (fetch) upstream https://github.com/aws-samples/serverless-coffee (push)
Create a new local branch for each serverlesspresso extension or modification being made. This allows you to create separate pull requests in the upstream repo.
-
Create and checkout a new local branch before making code changes:
git checkout -b {branch-name}
Branch name syntax:
{username}-{feature|fix}-{description}
Example branch name:
Cloudatch Dashboard
-
For verification, display all branches:
git branch -a
The output should look like this:
* {branch-name} main remotes/origin/HEAD → origin/main remotes/origin/main
Now is the time to create your new serverlesspresso extension or modify existing code.
- If you are creating a new serverlesspresso extension, copy the folder named "_extension-model" to start with a template:
cp -r _extension-model {new-folder-name}
- If you are modifying existing code, make your code changes now.
- When your code is complete, stage the changes to your local branch:
git add .
- Commit the changes to your local branch:
git commit -m 'Comment here'
Push your code to the remote repos and create a pull request.
-
Push the local branch to the remote origin repo:
git push origin {branch-name}
If this is the first push to the remote origin repo, you will be asked to Connect to GitHub to authorize the connection. Sometimes the pop-up window appears behind other windows.
-
Go to the upstream repo in Github and click "Compare & pull request".
-
Enter an appropriate title:
Example title:
New serverlesspresso extension - lambda-aurora-serverless
-
Add a description of the changes.
-
Click "Create pull request".
-
-
Submit a new issue to provide the additional details that will be used to build the serverlesspresso extension.
- Provide responses to each section (eg: Description, Language, Framework, etc.)
- Add a link to the pull request in the "GitHub PR for template" section. If you type a hashtag (#), it will display a list of the current pull requests to select from.
- Consider adding a few links to AWS documentation in the "Additional resources" section to provide more information about your serverlesspresso extension.
- Be sure to provide your information in the "Author bio" section.
- Click "Submit new issue".
- Example issue: https://github.com/aws-samples/serverless-coffee/issues/57
After your pull request has been accepted into the upstream repo:
- Switch to your local main branch:
git checkout main
- Pull changes that occurred in the upstream repo:
git fetch upstream
- Merge the upstream main branch with your local main branch:
git merge upstream/main main
- Push changes from you local repo to the remote origin repo:
git push origin main
Delete any unnecessary local and origin branches.
- Switch to your local main branch:
git checkout main
- For verification, display all branches:
git branch -a
- Delete any unnecessary local branches:
git branch -d {branch-name}
- Delete any unnecessary remote origin branches:
git push origin --delete {branch-name}
-
When creating a README file for your serverlesspresso extension, place example code and commands within a
code block
. -
When deploying with SAM, use SAM policy templates for permissions whenever possible.
-
Within your code and the SAM template, use comments liberally to help others understand what is going on.
-
You do not need to create the architecture diagram image that appears above each serverlesspresso extension on ServerlessLand.com. The team that manages the website is responsible for creating the image.
-
For Lambda functions, include test cases in both CLI and JSON with example data.
Example CLI Lambda invoke with test event:
aws lambda invoke --function-name YOUR_FUNCTION_NAME --invocation-type Event --payload '{"Key1": "Value1","Key2": "Value2"}' output.txt
Example JSON Lambda test event:
{ "Key1": "Value1", "Key2": "Value2" }