Giter VIP home page Giter VIP logo

aws-sam-codebuild-ci's Introduction

AWS SAM CodeBuild CI Build Status

This serverless app sets up an AWS CodeBuild Project as a CI solution for a GitHub-based SAM project. Once setup, every time you push to a branch in your GitHub repository, CodeBuild will kick off a build verifying your latest changes. This can be used as an automated check on pull requests (PRs) to your GitHub repo. This app also uses github-codebuild-logs app to allow anyone to view the build logs from AWS CodeBuild Project in pull requests.

Installation

  1. Create an AWS account if you do not already have one and login
  2. Create a GitHub OAuth token (see instructions below).
  3. Connect AWS CodeBuild to your GitHub account via the AWS Console (see instructions below).
  4. Go to this app's page on the Serverless Application Repository and click "Deploy"
  5. Provide the required app parameters and click "Deploy"

Creating a GitHub OAuth token

General instructions for creating a GitHub OAuth token can be found here. When you get to the scopes/permissions page, you should select the "repo" and "admin:repo_hook" scopes, which will automatically select all permissions under those two scopes.

GitHub OAuth Token Permissions

Connect AWS CodeBuild to your GitHub account

Connecting AWS CodeBuild for your account to your GitHub account is a manual step that only needs to be performed once for your account in a given region. To do this, follow these steps:

  1. Login to the AWS CodeBuild Console.
  2. Switch to the region to which you're going to deploy the CI app.
  3. Click "Create Project".
  4. Scroll down to the "Source" section.
  5. Select "GitHub" as the source provider.
  6. Click "Connect to GitHub".
  7. AWS CodeBuild is now connected to your GitHub account. You do not need to complete the Create Project flow and can close the page and return to the installation steps.

Note: If you do not see the "Connect to GitHub" button in step 6 and instead see options to select one of your GitHub repositories, AWS CodeBuild is already connected to your GitHub account and no further action is necessary.

Parameters

The app has the following parameters:

  1. GitHubOwner (required) - GitHub username owning the repo.
  2. GitHubRepo (required) - GitHub repo name (just the name, not the full URL).
  3. GitHubOAuthToken (required) - OAuth token used by AWS CodeBuild to connect to GitHub.
  4. ComputeType (optional) - AWS CodeBuild project compute type to use. See [Create a Build Project (AWS CLI)] (https://docs.aws.amazon.com/codebuild/latest/userguide/create-project.html#create-project-cli) for details. Default: BUILD_GENERAL1_SMALL
  5. EnvironmentType (optional) - Environment type used by AWS CodeBuild. See [Create a Build Project (AWS CLI)] (https://docs.aws.amazon.com/codebuild/latest/userguide/create-project.html#create-project-cli) for details. Default: LINUX_CONTAINER

App Outputs

  1. CodeBuildProjectName - Name of the CodeBuild project.
  2. CodeBuildProjectArn - ARN of the CodeBuild project.
  3. ArtifactsBucketName - Name of the Artifacts S3 bucket used by CodeBuild.
  4. ArtifactsBucketArn - ARN of the Artifacts S3 bucket used by CodeBuild.

License Summary

This sample code is made available under the MIT-0 license. See the LICENSE file.

aws-sam-codebuild-ci's People

Contributors

honglu avatar jamesiri avatar jlhood avatar mark-hirayama avatar zgre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.