Skip to content

Commit

Permalink
Merge pull request #1 from taoyong-ty/main
Browse files Browse the repository at this point in the history
Add the initial set of starter templates
  • Loading branch information
taoyong-ty authored Nov 6, 2024
2 parents 520406f + 2c3368c commit 5cc17d0
Show file tree
Hide file tree
Showing 63 changed files with 8,403 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
21 changes: 21 additions & 0 deletions .github/workflows/validate-templates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Validate Templates

on: [pull_request, push]

jobs:
validate-templates:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npm run test
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- run: pip install -U cfn-lint
- run: cfn-lint templates/cloudformation/* --non-zero-exit-code warning
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/node_modules
/build
/dist
/coverage
/generated-metadata
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules
/build
/dist
/coverage
56 changes: 51 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,57 @@
## My Project
# CodePipeline Starter Templates

TODO: Fill this README out!
This repository contains a collection of starter templates for AWS CodePipeline, designed to help users quickly set up and configure their CI/CD pipelines for various project types and deployment scenarios.

Be sure to:
## Repository Structure

* Change the title in this README
* Edit your repository description on GitHub
- `/templates`: Contains the main components of the starter templates
- `/metadata`: JSON files describing each template. These files control how templates are rendered in the CodePipeline console. For more details on the schema and usage, refer to the [metadata README](templates/metadata/README.md).
- `/cloudformation`: CloudFormation templates for each pipeline configuration.
- `/ui-hints`: JSON files controlling the rendering of template configuration in the CodePipeline console. These files define how the template configuration step is displayed. For more information on the schema and usage, refer to the [UI hints README](templates/ui-hints/README.md).
- `assets`: Contains svg icons for the starter templates


## Development

This project uses Node.js for development tasks. To set up the development environment:

1. Ensure you have Node.js 18 or later installed
2. Run `npm install` to install dependencies

### Adding new templates

To add a new template, follow these steps:

1. Create a new metadata file for the template in the `/templates/metadata` folder. This file should conform to the schema defined in `/templates/metadata/schema.json`.
2. Add the corresponding CloudFormation template file in the `/templates/cloudformation` folder.
3. The build script will automatically validate the metadata and CloudFormation template files, and generate the synthesized files for the CodePipeline Console to render.

### Adding new icons

You are not required to add a new icon for your template. You can use the existing `codepipeline.svg` icon located in the `assets/icons/` folder.

If you want to add a new icon to this package,
1. Add the SVG file to the `assets/icons/` folder in this project.
2. The icon-name in the metadata should correspond to the relevant folder, for example, `icon-name: lambda` expects an icon file at `asset/icons/lambda.svg`.


### Testing your changes

Our [template validation workflow](.github/workflows/validate-templates.yaml) involves JSON schema validation using npm and CloudFormation linting using [cfn-lint](https://github.com/aws-cloudformation/cfn-lint). To test your changes locally:

1. Ensure you have npm and cfn-lint installed on your system.
2. Run the following command to validate the JSON files:
```
npm run test
```
3. Run the following command to validate the CloudFormation files:
```
cfn-lint templates/cloudformation/*
```

## Contributing

We welcome contributions to this project. Please read our [Contributing Guidelines](CONTRIBUTING.md) for more information on how to add new templates or improve existing ones.

## Security

Expand Down
10 changes: 10 additions & 0 deletions assets/icons/appconfig.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/icons/cloudformation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/icons/codepipeline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/icons/ec2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/icons/ecr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/icons/ecs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5cc17d0

Please sign in to comment.