Skip to content

Create a CI pipeline using AWS CodePipeline and AWS CodeBuild to automatically deploy your Serverless project when changes are committed.

License

Notifications You must be signed in to change notification settings

mscifo/serverless-aws-ci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serverless-aws-ci

serverless npm version MIT licensed

Create a CI pipeline using AWS CodePipeline and AWS CodeBuild to automatically deploy your Serverless project when changes are committed.

Getting Started

Prerequisites

Make sure you have the following installed before starting:

The AWS credentials used to create the CI pipeline via the serverless command will need the following permissions:

cloudformation:DescribeStackResources
codebuild:CreateProject
codebuild:ListBuilds
codepipeline:CreatePipeline

The IAM role (specified via the custom.awsCI.roleArn configuration) that AWS CodePipeline and AWS CodeBuild will assume will need to be assigned the AWSCodeBuildDeveloperAccess policy AND be assigned the following permissions:

logs:CreateLogGroup
logs:CreateLogStream

Installing

# From npm (recommended)
npm install serverless-aws-ci

# From github
npm install https://github.com/mscifo/serverless-aws-ci.git

Then make the following edits to your serverless.yml file:

plugins:
  - serverless-aws-ci

custom:
  awsCI:
    roleArn:  # (required) the AWS ARN for the role CodePipeline/CodeBuild will assume

Running

To create the pipeline (you only need to run this once per branch/stage):

serverless awsci -g [GITHUB_OWNER/GITHUB_REPO] -b [GITHUB_BRANCH] -t [GITHUB_PERSONAL_ACCESS_TOKEN] -s [STAGE]

Be sure to commit the created buildspec.yml so the pipeline will know how to deploy your Serverless project.

Running Tests

To run the test:

npm test

All tests should pass.

About

Create a CI pipeline using AWS CodePipeline and AWS CodeBuild to automatically deploy your Serverless project when changes are committed.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published