Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Commit 5b023ab

Browse files
authored
Merge pull request #1 from awslabs/feature/initial
Feature/initial
2 parents 82a50b4 + 7b4841b commit 5b023ab

34 files changed

+6007
-41
lines changed

.gitignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
node_modules
3+
.idea
4+
*~
5+
.build
6+
.pt
7+
*.swp
8+
.DS_Store
9+
.nyc_output/
10+
*.csv
11+
*.tgz
12+
# Logs
13+
logs
14+
*.log
15+
npm-debug.log
16+
.tmp
17+
18+
# Runtime data
19+
pids
20+
*.pid
21+
*.seed
22+
dist
23+
24+
# Directory for instrumented libs generated by jscoverage/JSCover
25+
lib-cov
26+
27+
# Coverage directory used by tools like istanbul
28+
coverage
29+
30+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
31+
.grunt
32+
33+
# node-waf configuration
34+
.lock-wscript
35+
36+
# Compiled binary addons (http://nodejs.org/api/addons.html)
37+
build/Release
38+
39+
**/.idea
40+
.serverless/
41+
*.sw?
42+
vim-markdown-preview.html
43+
.vscode/
44+
# Temporary output generate during build
45+
build-artifacts/
46+
47+
# Temporary Git repo for checking changes
48+
_GIT_REPO/
49+
.vscode/
50+
51+
*.gitignored
52+
53+
# Compiled class file
54+
*.class
55+
56+
# Maven
57+
**/target/
58+
**/.settings/
59+
60+
# CDK
61+
**/cdk.out/
62+
*.js
63+
*.d.ts
64+
65+
# Transpiled typescript files
66+
build/
67+

CODE_OF_CONDUCT.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
## Code of Conduct
2-
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
3-
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
1+
# Code of Conduct
2+
3+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
4+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
45
opensource-codeofconduct@amazon.com with any additional questions or comments.

CONTRIBUTING.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
# Contributing Guidelines
22

3-
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
3+
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
44
documentation, we greatly value feedback and contributions from our community.
55

6-
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
6+
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
77
information to effectively respond to your bug report or contribution.
88

9-
109
## Reporting Bugs/Feature Requests
1110

1211
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
1312

14-
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
13+
When filing an issue, please check [existing open](https://github.com/awslabs/aws-simple-cicd/issues), or [recently closed](https://github.com/awslabs/aws-simple-cicd/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
1514
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
1615

1716
* A reproducible test case or series of steps
1817
* The version of our code being used
1918
* Any modifications you've made relevant to the bug
2019
* Anything unusual about your environment or deployment
2120

22-
2321
## Contributing via Pull Requests
22+
2423
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
2524

2625
1. You are working against the latest source on the *master* branch.
@@ -36,26 +35,25 @@ To send us a pull request, please:
3635
5. Send us a pull request, answering any default questions in the pull request interface.
3736
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
3837

39-
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
38+
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4039
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
4140

42-
4341
## Finding contributions to work on
44-
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
4542

43+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/awslabs/aws-simple-cicd/labels/help%20wanted) issues is a great place to start.
4644

4745
## Code of Conduct
48-
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
49-
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
50-
opensource-codeofconduct@amazon.com with any additional questions or comments.
5146

47+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
48+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
49+
opensource-codeofconduct@amazon.com with any additional questions or comments.
5250

5351
## Security issue notifications
54-
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
5552

53+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
5654

5755
## Licensing
5856

59-
See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
57+
See the [LICENSE](https://github.com/awslabs/aws-simple-cicd/blob/master/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
6058

6159
We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.

LICENSE

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
MIT License
1+
MIT No Attribution
22

3-
Copyright (c) 2020 Amazon.com
3+
Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
SPDX-License-Identifier: MIT-0
45

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
7+
software and associated documentation files (the "Software"), to deal in the Software
8+
without restriction, including without limitation the rights to use, copy, modify,
9+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so.
1111

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
15+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
16+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,46 @@
1-
## My Project
1+
# AWS-Simple-CICD Project
22

3-
TODO: Fill this README out!
3+
This project aims to provide a production-grade, serverless CI/CD platform built using native AWS services provisioned using AWS Cloud Development Kit (CDK). As per the AWS Well Architected Framework, this project assumes the use of multiple AWS accounts for secure isolation of environments.
44

5-
Be sure to:
5+
This CI/CD platform is in use at a variety of AWS clients where the development teams are leveraging CloudFormation, Serverless Framework, AWS CDK and Terraform.
66

7-
* Change the title in this README
8-
* Edit your repository description on GitHub
7+
## Goals
98

10-
## License
9+
- Bring Developers closer to their infrastructure and operations by providing a prescriptive platform.
10+
- Support for (almost) any toolset the application developers want to use e.g. Terraform, CDK, Cloudformation, Pulumi etc.
11+
- Minimize platform lock-in. Applications can be migrated to other CI/CD orchestration platform with minimal changes required by the developers.
12+
- Enables "you build it, you run it".
1113

12-
This project is licensed under the Apache-2.0 License.
14+
## Features
1315

16+
- Cloud native and built on top of [AWS Serverless CI/CD tools](https://aws.amazon.com/serverless/developer-tools/)
17+
- Plug & Play on top of [AWS Landing Zone](https://aws.amazon.com/solutions/implementations/aws-landing-zone/)/[Control Tower](https://aws.amazon.com/controltower/)
18+
- Supports pipeline notifications via [AWS SNS](https://aws.amazon.com/sns/)
19+
- Supports branches (pipeline per branch)
20+
- Auto-increments [semantic versioning](https://www.semver.org) per pipeline.
21+
22+
## Architecture
23+
24+
This is the pipeline that will be generated for each repository. The build and deployment stages in the pipeline execute a user defined shell script in an isolated docker container. The docker environment is provisioned on the fly by AWS CodeBuild.
25+
26+
The number of stages and their function is fully customizable e.g. adding a stage for security/vulnerability scanning, adding a stage for executing test cases etc.
27+
28+
![Architecture](./architecture.png "CI/CD Architecture")
29+
30+
### AWS services
31+
32+
- AWS CodeCommit (or any source control providor supported by CodePipeline)
33+
- AWS CodePipeline
34+
- AWS CodeBuild
35+
- AWS Lambda
36+
- AWS S3
37+
- AWS SNS
38+
- AWS CloudWatch
39+
- AWS Systems Manager: Parameter Store
40+
- AWS CloudFormation
41+
42+
## Getting started
43+
44+
- [Pre-Requisites](docs/prereq.md)
45+
- [Administrator Guide](docs/admin.md)
46+
- [Developer Guide](docs/developer.md)

THIRD_PARTY_NOTICES

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
** python-semver; version 2.9.1 --
2+
https://github.com/python-semver/python-semver
3+
Copyright (c) 2013, Konstantine Rybnikov
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification,
8+
are permitted provided that the following conditions are met:
9+
10+
Redistributions of source code must retain the above copyright notice, this
11+
list of conditions and the following disclaimer.
12+
13+
Redistributions in binary form must reproduce the above copyright notice,
14+
this
15+
list of conditions and the following disclaimer in the documentation and/or
16+
other materials provided with the distribution.
17+
18+
Neither the name of the {organization} nor the names of its
19+
contributors may be used to endorse or promote products derived from
20+
this software without specific prior written permission.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26+
FOR
27+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

architecture.drawio

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<mxfile host="drawio.corp.amazon.com" modified="2020-06-04T22:42:30.421Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" etag="SqxcFsqvOM3Tzoij2Pwu" version="12.4.8" type="device"><diagram id="6hGFLwfOUW9BJ-s0fimq" name="Page-1">7VvZbuM2FP0aA+1DA62W/eglyRRIgQAuMJOngJZoma0kqhTlpV/fS4m0FsrNBF6UzDgTILqXFJfDc0heUjOwZ/HukaF0/QcNcDSwjGA3sOcDyzLH1hD+CM++9Ixto3SEjAQyU+VYkH+xdKpsOQlw1sjIKY04SZtOnyYJ9nnDhxij22a2FY2ataYoxJpj4aNI934lAV+X3pFrVP4vmIRrVbNpyJQYqczSka1RQLc1l30/sGeMUl4+xbsZjgR4CpfyvYcjqYeGMZzw73nBKl/YoCiXfZt8XYBjFtE8kE3ke9XvlJKEF9i5U/iFomfGwIWUmbDuLLflaNte02Hqliij6WjbXtNhtos3W/Wb7QbWHJrVKN5o1W/UGgi/9pTmPCIJnh1YZoAzZCgggP6MRpSBL6EJoDdd8zgCy4TH7ZpwvEiRL1DdgkLAt6IJlzw3LWVL4EWpwJNUPMe7UEjqDm0z5y5kNE+LKn8HpnemvsLjqy8G8xVFXBTEGf0bq8YNLBv+PQhuTFckilqN3mDGCdB+EpFQlM+pqA5JK8KrokToCUnCp8Ka24ZsfVcVAcrWOJBd0qkq2StqxbuaS1L3EdMYc7aHLDJ1JFUkpxFHmttKk54S2rqmx6F6D8l5IDyUXEkFHqRaupUz1JSzWENfggVmG+LD7GQZE9+nOXTuJqMfR0Y/moRMs6mhg10Tke10iMh1XUGMU2VkazKa481NOzftfALtDJ2WdlxdO6bdoZ2D8xTlOJpy/sQZv0nnJp1PKB3bsgoCXE09rqaeZ0aDm3pu6vmE6nFG11x4TFsTBw5CrIaMMr6mIU1QdF95pzAgSXDAoMrzRAW2BTf+wpzvJRFQzmmTOUdhy2jOfNwIyjhiIeaNDaZo4f9Cy3CEONk0T3hOgsnpAyZAh+2/yfcL40UYIGVpznf1xPn+LVa+Aa/TG7xuL/DuCP9We66BC1aFrTBOhdbtC1pPWxtnNIC5M46Jvi52LgTHJsL2AgFpztyDxFranDAoiBSTeiKGqDVHwzvw40zHXbP6qvhpT7lqPn9CSxw904zI4peUcxq/OeH70CrMmkR4a9FCWVrCsSI7HBxbxRguOVCuYVMwu1YzH9D3S/TPsnzYbituGVna8uGN9NVD+U7h1ljj1hOKlwEC3xccpZhlZ2fYgze6N5z3MWxuuDPT+2kYFpVjcBF2Oeb12GWaGr00OlVrwLEN6ffsOt5xwjZs4mF1nLCZXcfUjnOGzdqocy5/JikWmrrN5v3M5qnC/zwMG5nN+bzjHOpiitNvEAXBpjmJghu7+mHXsgD/IpO5bZjXo1bHFRtEc8YvCAZghQAxa1jcaS4ZPIXl7SZlKMS/np15Q2Ni2977mGd5ngl9+FmYl9mXoZzbda17IcpZ/QSVh5i9CtNfBvUo/YSY3ZTRXD2yVLuNHqJ2PbZ8xLxq8vHNmnGdzVrrkwJrqJNv1LVXOwM26gzgA56rKcI0SGT2RSLVmhqJuvcbfbPHtq7IHu/jskd9o1dnj9Ube/QYcY7TiIrKoHuWUXyA8NGY1HHCfzEmjXpZBOXJanWa+lJL6T5ZvejCqRjaYG1vx92qNUdZW17+fzDaOs74erTt+pSojlB5wds3Qmqbqna34ysKe3wTdk3EDWH3dk3Y8R2PimtFtNYYruE/OVUJv2UF4BPIME53VZoKhSdpyigUqgfJygMtK2tQ7rY01jRe5tl1ZDG2m7Iwxnf65yBuhzDc948BmNUX9kVa7f8p2Pf/AQ==</diagram></mxfile>

architecture.png

75.7 KB
Loading

bin/cicd.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: MIT-0
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
6+
* software and associated documentation files (the "Software"), to deal in the Software
7+
* without restriction, including without limitation the rights to use, copy, modify,
8+
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9+
* permit persons to whom the Software is furnished to do so.
10+
*
11+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
12+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
13+
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
14+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
15+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
16+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17+
*/
18+
19+
20+
import 'source-map-support/register'
21+
import cdk = require('@aws-cdk/core')
22+
import { CicdStack } from '../lib/cicd-stack'
23+
import { S3Stack } from '../lib/cicd-s3-stack'
24+
import { EmailHandlerStack } from '../lib/emailHandler-stack'
25+
import { SemverHandlerStack } from '../lib/semverHandler-stack'
26+
import {default as config } from '../config/config'
27+
28+
// Setup prefix
29+
let prefix = `${config.naming.company}-${config.naming.dept}-${config.naming.project}`
30+
let ssmRoot = `/${config.naming.company}/${config.naming.dept}/${config.naming.project}`
31+
32+
33+
const app = new cdk.App()
34+
35+
new S3Stack(app, 'AWS-Simple-CICD-S3', { prefix, ssmRoot })
36+
new EmailHandlerStack(app, 'AWS-Simple-CICD-EmailHandler', { prefix, ssmRoot })
37+
new SemverHandlerStack(app, 'AWS-Simple-CICD-SemverHandler', { prefix, ssmRoot })
38+
new CicdStack(app, 'AWS-Simple-CICD-TeamOne', { prefix, ssmRoot, repos: config.teamOne})
39+
//new CicdStack(app, 'TeamTWo-CICD', { prefix, ssmRoot, repos: config.teamTwo})

cdk.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"app": "node build/bin/cicd.js"
3+
}

0 commit comments

Comments
 (0)