All Projects → awslabs → Aws Codebuild Jenkins Plugin

awslabs / Aws Codebuild Jenkins Plugin

Licence: apache-2.0
AWS CodeBuild integration as a Jenkins build step.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Aws Codebuild Jenkins Plugin

Iopipe Js Core
Observe and develop serverless apps with confidence on AWS Lambda with Tracing, Metrics, Profiling, Monitoring, and more.
Stars: ✭ 123 (-6.82%)
Mutual labels:  aws, serverless, devops
Aws Serverless Cicd Workshop
Learn how to build a CI/CD pipeline for SAM-based applications
Stars: ✭ 158 (+19.7%)
Mutual labels:  aws, serverless, devops
Aws To Slack
Forward AWS CloudWatch Alarms and other notifications from Amazon SNS to Slack.
Stars: ✭ 261 (+97.73%)
Mutual labels:  aws, serverless, devops
Terrahub
Terraform Automation and Orchestration Tool (Open Source)
Stars: ✭ 148 (+12.12%)
Mutual labels:  serverless, devops, continuous-integration
Serverless Plugin Canary Deployments
Canary deployments for your Serverless application
Stars: ✭ 283 (+114.39%)
Mutual labels:  aws, serverless, continuous-integration
Website
⚡️ Instantly deploy static website on serverless infrastructure with zero configuration using Serverless Components.
Stars: ✭ 118 (-10.61%)
Mutual labels:  aws, serverless
Serverless Architectures Aws
The code repository for the Serverless Architectures on AWS book
Stars: ✭ 120 (-9.09%)
Mutual labels:  aws, serverless
Full Stack Serverless Cdk
Learn to Build Full-Stack Serverless Apps and APIs using AWS Cloud Development Kit (CDK) in Baby Steps.
Stars: ✭ 122 (-7.58%)
Mutual labels:  aws, serverless
Aws Lambda R Runtime
Serverless execution of R code on AWS Lambda
Stars: ✭ 121 (-8.33%)
Mutual labels:  aws, serverless
Delivery Pipeline Plugin
Jenkins plugin for pipeline visualisation, perfect for Continuous Delivery
Stars: ✭ 122 (-7.58%)
Mutual labels:  continuous-integration, jenkins-plugin
Hexaville
The modern serverless web application engine and framework for Swift
Stars: ✭ 123 (-6.82%)
Mutual labels:  aws, serverless
Aws Lambda List
A list of hopefully useful AWS lambdas and lambda-related resources.
Stars: ✭ 130 (-1.52%)
Mutual labels:  aws, serverless
Apisix Docker
the docker for Apache APISIX
Stars: ✭ 119 (-9.85%)
Mutual labels:  serverless, devops
Terraform
Terraform automation for Cloud
Stars: ✭ 121 (-8.33%)
Mutual labels:  aws, devops
Auto Remediate
Cloud Conformity Auto Remediate
Stars: ✭ 119 (-9.85%)
Mutual labels:  aws, serverless
Serverless Layers
Serverless.js plugin that implements AWS Lambda Layers which reduces drastically lambda size, warm-up and deployment time.
Stars: ✭ 119 (-9.85%)
Mutual labels:  aws, serverless
Designing Cloud Native Microservices On Aws
Introduce a fluent way to design cloud native microservices via EventStorming workshop, this is a hands-on workshop. Contains such topics: DDD, Event storming, Specification by example. Including the AWS product : Serverless Lambda , DynamoDB, Fargate, CloudWatch.
Stars: ✭ 131 (-0.76%)
Mutual labels:  aws, serverless
Architect
The simplest, most powerful way to build serverless applications
Stars: ✭ 1,925 (+1358.33%)
Mutual labels:  aws, serverless
Aws Serverless Event Fork Pipelines
AWS Event Fork Pipelines helps you build event-driven serverless applications by providing pipelines for common event-handling requirements, such as event backup, analytics, and replay. The pipelines are based on AWS SAM, and can be deployed directly from AWS SAR into your AWS account.
Stars: ✭ 126 (-4.55%)
Mutual labels:  aws, serverless
Serverless Prisma
AWS Serverless Prisma Boilerplate
Stars: ✭ 126 (-4.55%)
Mutual labels:  aws, serverless

AWS CodeBuild Jenkins Plugin

The AWS CodeBuild plugin for Jenkins provides a build step for your Jenkins project.

Build Status license Build Status

Plugin Installation

If you already have a Jenkins setup and would like to only install the AWS CodeBuild plugin, then the recommended approach would be to search for "AWS CodeBuild" in the Plugin Manager on your Jenkins instance.

We have also written a blog post for setting up a new Jenkins server with AWS CloudFormation and integrating it with AWS CodeBuild and AWS CodeDeploy. Learn more: https://aws.amazon.com/blogs/devops/setting-up-a-ci-cd-pipeline-by-integrating-jenkins-with-aws-codebuild-and-aws-codedeploy

Plugin Usage

Using AWS CodeBuild with source available outside of your VPC

  1. Create Project on the AWS CodeBuild console.

    • Switch to the region you would prefer to run the build in.
    • You can optionally set the Amazon VPC configuration to allow CodeBuild build container to access resources within your VPC.
    • Make sure to write down the project's name.
    • (Optional) If your source repository is not natively supported by CodeBuild, you can set the input source type for your project as S3 for the CodeBuild project.
  2. Create AWS IAM user to be used by the Jenkins plugin.

    • Create a policy similar to the one following this section.
    • Go to the IAM console, and create a new user.
      • Access type should be: Programmatic Access.
      • Attach policy to user that you created previously.
  3. Create a freestyle project in Jenkins.

    • On the Configure page, choose Add build step > Run build on AWS AWS CodeBuild.
    • Configure your build step.
      • Enter Region, Credentials from the user created previously, and ProjectName.
      • Select Use Project source.
      • Save the configuration and run a build from Jenkins.
  4. For the Source Code Management make sure to select how you would like to retrieve your source. You may need to install the GitHub Plugin (or the relevant source repository provider's Jenkins plugin) to your Jenkins server.

    • On the Configure page, choose Add build step > Run build on AWS CodeBuild. Configure the build step.
    • Enter Region, Credentials from the user created previously, and Project name.
    • Select Use Jenkins source.
    • Save the configuration and run a build from Jenkins.

Policy sample for IAM user:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Resource": ["arn:aws:logs:{{region}}:{{awsAccountId}}:log-group:/aws/codebuild/{{projectName}}:*"],
            "Action": ["logs:GetLogEvents"]
        },
        {
            "Effect": "Allow",
            "Resource": ["arn:aws:s3:::{{inputBucket}}"],
            "Action": ["s3:GetBucketVersioning"]
        },
        {
            "Effect": "Allow",
            "Resource": ["arn:aws:s3:::{{inputBucket}}/{{inputObject}}"],
            "Action": ["s3:PutObject"]
        },
        {
            "Effect": "Allow",
            "Resource": ["arn:aws:s3:::{{outputBucket}}/*"],
            "Action": ["s3:GetObject"]
        },
        {
            "Effect": "Allow",
            "Resource": ["arn:aws:codebuild:{{region}}:{{awsAccountId}}:project/{{projectName}}"],
            "Action": ["codebuild:StartBuild",
                       "codebuild:BatchGetBuilds",
                       "codebuild:BatchGetProjects"]
        }
	]
}

Using the AWS CodeBuild plugin with the Jenkins Pipeline plugin

Use the snippet generator (click "Pipeline Syntax" on your pipeline project page) to generate the pipeline script that adds CodeBuild as a step in your pipeline. It should generate something like

awsCodeBuild projectName: 'project', credentialsType: 'keys', region: 'us-west-2', sourceControlType: 'jenkins'

Additionally, this returns a result object which exposes the following methods which can be useful to later steps:

  • getBuildId(): returns the build ID of the build (similar to codebuild-project-name:12346789-ffff-0000-aaaa-bbbbccccdddd)
  • getArn(): returns the ARN of the build (similar to arn:aws:codebuild:AWS_REGION:AWS_ACCOUNT_ID:build/CODEBUILD_BUILD_ID, where CODEBUILD_BUILD_ID is the same information returned in getBuildId)
  • getArtifactsLocation(): returns the S3 ARN of the artifacts location (similar to arn:aws:s3:::s3-bucket-name/path/to/my/artifacts)

AWS Credentials in Jenkins

It's recommended to use the Jenkins credentials store for your AWS credentials. Your Jenkins credentials must be of type CodeBuild Credentials to be compatible with the CodeBuild plugin. When creating new CodeBuild Credentials, the plugin will attempt to use the default credentials provider chain if AWS access and secret keys are not defined. You can also specify your AWS access and secret keys and session token in the CodeBuild configuration when using credentialsType: 'keys'. Example:

awsCodeBuild projectName: 'project', 
             credentialsType: 'keys',
	     awsAccessKey: env.AWS_ACCESS_KEY_ID,
	     awsSecretKey: env.AWS_SECRET_ACCESS_KEY,
	     awsSessionToken: env.AWS_SESSION_TOKEN,
	     ...

If the access/secret keys and session token are not specified, the plugin will attempt to use the default credentials provider chain. When running a Jenkins pipeline build, the plugin will attempt to use credentials from the pipeline-aws plugin before falling back to the default credentials provider chain. If you are running Jenkins on an EC2 instance, leave the access and secret key fields blank and specify credentialsType: 'keys'to use credentials from your EC2 instance profile, which is in the default credentials provider chain.

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