All Projects → nicolai86 → Awesome Codepipeline Ci

nicolai86 / Awesome Codepipeline Ci

Licence: mit
an AWS CodePipeline, AWS CodeBuild, AWS APIGateway & AWS Lambda CI

Labels

Projects that are alternatives of or similar to Awesome Codepipeline Ci

Cobalt
Infrastructure turn-key solution for app service workloads
Stars: ✭ 97 (-13.39%)
Mutual labels:  hcl
Libvirt K8s Provisioner
Automate your k8s installation
Stars: ✭ 106 (-5.36%)
Mutual labels:  hcl
Terraform Aws Vpc
An example of Terraform which brings up a VPC with Public/Private Subnets
Stars: ✭ 109 (-2.68%)
Mutual labels:  hcl
Example Pragmatic Terraform
『実践Terraform』のサンプルコード
Stars: ✭ 99 (-11.61%)
Mutual labels:  hcl
Terraform Aws Dynamic Subnets
Terraform module for public and private subnets provisioning in existing VPC
Stars: ✭ 106 (-5.36%)
Mutual labels:  hcl
Aws Accounts Terraform
Stars: ✭ 108 (-3.57%)
Mutual labels:  hcl
Terraform Ecs Jenkins
Provisions Jenkins on AWS ECS using Terraform
Stars: ✭ 93 (-16.96%)
Mutual labels:  hcl
Terraform Up And Running Code
Code samples for the book "Terraform: Up & Running" by Yevgeniy Brikman
Stars: ✭ 1,739 (+1452.68%)
Mutual labels:  hcl
Spinnaker Terraform
A set of terraform scripts to create an environment from scratch with a Bastion Host, Jenkins, and Spinnaker
Stars: ✭ 106 (-5.36%)
Mutual labels:  hcl
Terraform Google Vault
A Terraform Module for how to run Vault on Google Cloud using Terraform and Packer
Stars: ✭ 108 (-3.57%)
Mutual labels:  hcl
Aws Minikube
Single node Kubernetes instance implemented using Terraform and kubeadm
Stars: ✭ 101 (-9.82%)
Mutual labels:  hcl
Hcledit
A command line editor for HCL
Stars: ✭ 104 (-7.14%)
Mutual labels:  hcl
Aws Ecs Airflow
Run Airflow in AWS ECS(Elastic Container Service) using Fargate tasks
Stars: ✭ 107 (-4.46%)
Mutual labels:  hcl
Terraform Example
Terraform, Ansible, sticky tape and magic
Stars: ✭ 98 (-12.5%)
Mutual labels:  hcl
Terraform Aws Ecr
Terraform Module to manage Docker Container Registries on AWS ECR
Stars: ✭ 110 (-1.79%)
Mutual labels:  hcl
Vaultron
🤖 Vault clusters Terraformed onto Docker for great fun and learning!
Stars: ✭ 96 (-14.29%)
Mutual labels:  hcl
Solutions Terraform Cloudbuild Gitops
Stars: ✭ 106 (-5.36%)
Mutual labels:  hcl
Aws Lambda Es Cleanup
AWS Elasticsearch Lambda Curator
Stars: ✭ 112 (+0%)
Mutual labels:  hcl
Terraform Config
Terraform bits and bytes
Stars: ✭ 111 (-0.89%)
Mutual labels:  hcl
Terraform Aws Config
Enables AWS Config and adds managed config rules with good defaults.
Stars: ✭ 107 (-4.46%)
Mutual labels:  hcl

awesome-codepipeline

After several talks at work about the feasibility of using AWS Codebuild and AWS Codepipeline to verify the integrity of our codebase, I decided to give it a try.

We use pull-requests and branching extensively, so one requirement is that we can dynamically pickup branches other than the master branch. AWS Codepipeline only works on a single branch out of the box, so I decided to use Githubs webhooks, AWS APIGateway and AWS Lambda to dynamically support multiple branches:

Architecture

First, you create a master AWS CodePipeline, which will serve as a template for all non-master branches.
Next, you setup an AWS APIGateway & an AWS Lambda function which can create and delete AWS CodePipelines based off of the master pipeline.
Lastly, you wire github webhooks to the AWS APIGateway, so that opening a pull request duplicates the master AWS CodePipeline, and closing the pull request deletes it again.

architecture

Details

AWS Lambda

For the AWS Lambda function I decided to use golang & eawsy, as the combination allows for extremely easy lambda function deployments.
The implementation relies on the AWS go sdk to manage the CodePipeline.

AWS APIGateway

The APIGateway is managed via terraform, and it consists of a single API, where the root resource is wired up to handle webhooks. Github specific headers are transformed so they are accessible in the backend.

AWS CodePipeline

The CodePipeline serving as template is configured to run on master. This way all merged pull requests trigger tests on this pipeline, and every pull request itself runs on a separate AWS CodePipeline.
This is great because every PR can be checked in parallel.

AWS CodeBuild

In my example the AWS CodeBuild configuration is static. However one could easily make this dynamic, e.g. by placing AWS CodeBuild configuration files inside the repository. This way the PRs could actually test different build configurations.

Outcome

The approach outlined above works very well. It is reasonable fast and technically brings 100% utilization with it. And it brings great extensibility options to the table: one could easily use this approach to spin up entire per PR environments, and tear them down dynamically.
In the future I'm looking forward to working more with this approach, and maybe also abstracting it further for increased reusability.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].