Giter VIP home page Giter VIP logo

github-codebuild-webhook's Introduction

Github CodeBuild Webhook

This project will setup an api gateway endpoint, which you can have your github repository connect to. This will start and update a commit with the current build status. This will be triggered for any PR update, on any branch.

Installation

Use the steps below to launch the stack directly into your AWS account. You can setup as much stacks as you want, as the stack is currently connected to 1 CodeBuild project.

  1. First, we'll need to setup an AWS CodeBuild project. Create a new project in the AWS console, and be sure to add a buildspec.yml file to your project with some steps. Here's an example.

  2. Create a github api token in your account here, so that the stack is allowed to use your account: https://github.com/settings/tokens/new. You can ofcourse choose to setup a seperate account for this.

  3. Deploy the stack:

    Launch Awesomeness

    (or use sls deploy).

  4. Create a Pull Request on your project, and see the magic be invoked ๐Ÿ˜Ž

  5. ...

  6. Profit!

Architecture

Flow

When you create a PR, a notification is send to the Api Gateway endpoint and the lambda step function is triggered. This will trigger the start of a build for your project, and set a status of pending on your specific commit. Then it will start checking your build status every X seconds. When the status of the build changes to done or failed, the github api is called and the PR status will be updated accordingly.

Example output

In the Example below, a PR is create, and a build is run which fails. Then, a new commit is pushed, which fixes the build. When you click on the 'details' link of the PR status, it will take you to the CodeBuild build log.

AWS Codebuild Triggered after PR update

Todo

  • Add (optional) junit parsing, so it can comment on files with (possible) issues.
  • Perhaps make build project dynamic through apigateway variable if possible

github-codebuild-webhook's People

Contributors

svdgraaf avatar kevincharm avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.