SlideShare uma empresa Scribd logo
1 de 116
Baixar para ler offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continuous Integration
Best Practices
Nick Brandaleone Joseph Vusich
Senior Solutions Architect Senior Software Development Engineer
AWS AWS
D E V 3 1 9
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
Introduction to Continuous Integration
Continuous Integration Tooling
CI best practices and techniques
Demo
Review
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Breakout repeats
DEV319 - Continuous Integration Best Practices
Monday, Nov 26, 4:00 PM - 5:00 PM
Venetian, Level 2, Titian 2204
DEV319 - Continuous Integration Best Practices
Tuesday, Nov 27, 3:15 PM - 4:15 PM
Venetian, Level 5, Palazzo O
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Related breakouts
DEV317 - Advanced Continuous Delivery Best Practices
Monday, Nov 26, 1:45 PM - 2:45 PM Tuesday, Nov 27, 2:30 PM - 3:30 PM
Venetian, Level 5, Palazzo O. Aria East, Level 1, Joshua 9
DEV309 - CI/CD for Serverless and Containerized Applications
Tuesday, Nov 27, 7:00 PM - 8:00 PM. Thursday, Nov 29, 2:30 PM - 3:30 PM
Venetian, Level 2, Venetian E. Bellagio, Level 1, Grand Ballroom 2
Thursday, November 29
Leadership Session: Using DevOps, Microservices, and Serverless
to Accelerate Innovation (SRV325)
12:15 – 1:15 PM | Venetian Theatre (Level 2)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
“Continuous Integration is a software
development practice where members
of a team integrate frequently …
verified by an automatic build and test
process…”
Martin Fowler
“Continuous Integration produces and
validates artifacts, while Continuous
Deployment deploys them.”
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is continuous integration?
1. Developers regularly check in code to a
shared, central repository
2. Automated checks run regularly against
the shared codebase
3. Developers get feedback from the
automated checks about their code
Developer
Shared codebaseAutomated checks
Check
in code
Get
feedback
Run
checks
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is continuous integration?
1. Developers regularly check in code to a
shared, central repository
2. Automated checks run regularly against
the shared codebase
3. Developers get feedback from the
automated checks about their code
Developer
Shared codebaseAutomated checks
Check
in code
Get
feedback
Run
checks
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is continuous integration?
1. Developers regularly check in code to a
shared, central repository
2. Automated checks run regularly against
the shared codebase
3. Developers get feedback from the
automated checks about their code
Developer
Shared codebaseAutomated checks
Check
in code
Get
feedback
Run
checks
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is continuous integration?
1. Developers regularly check in code to a
shared, central repository
2. Automated checks run regularly against
the shared codebase
3. Developers get feedback from the
automated checks about their code
Developer
Shared codebaseAutomated checks
Check
in code
Get
feedback
Run
checks
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Typical Developer workflow
1) Write code - Cloud9
2) Compile and run unit tests locally - CodeBuild Local
3) Push code to a Git repository - CodeCommit
4) Build the updated images - CodeBuild
5) Run integration tests against new code - CodeBuild
6) Push new images to registry - CodeBuild and Elastic Container Registry
7) Trigger a deployment - CodeBuild or CloudWatch Events + Lambda
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why does continuous integration
matter?
• Find bugs earlier
• Fix bugs faster
• Deliver faster
• Deliver more often
• Unblock developers
• Grow developers
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why does continuous integration
matter?
• Find bugs earlier
• Fix bugs faster
• Deliver faster
• Deliver more often
• Unblock developers
• Grow developers
Quality:
5x
lower change
failure rate
Source: 2017 State of DevOps Report (Puppet)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why does continuous integration
matter?
• Find bugs earlier
• Fix bugs faster
• Deliver faster
• Deliver more often
• Unblock developers
• Grow developers
Delivery:
440x
faster from
commit to deploy
Source: 2017 State of DevOps Report (Puppet)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why does continuous integration
matter?
• Find bugs earlier
• Fix bugs faster
• Deliver faster
• Deliver more often
• Unblock developers
• Grow developers
Delivery:
46x
more frequent
deployments
Source: 2017 State of DevOps Report (Puppet)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why does continuous integration
matter?
• Find bugs earlier
• Fix bugs faster
• Deliver faster
• Deliver more often
• Unblock developers
• Grow skills faster
Happy teams:
44%
more time spent
on new features
and code
Source: 2017 State of DevOps Report (Puppet)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Teams that practice CI/CD ship more code faster,
and with more confidence
5x
Lower change
failure rate
440x
Faster from
commit to deploy
46x
More frequent
deployments
44%
More time spent
on new features
Source: Puppet 2017 State of DevOps Report
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Summary
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continuous integration tools
Developer
Shared codebaseAutomated checks
Check
in code
Get
feedback
Run
checks
Source Code
• AWS CodeCommit
• GitHub
• GitHub Enterprise
• Bitbucket
• S3
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continuous integration tools
Developer
Shared codebaseAutomated checks
Check
in code
Get
feedback
Run
checks
Build & Test
• AWS CodeBuild
• Jenkins w/ CodeBuild
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continuous integration tools
Developer
Shared codebaseAutomated checks
Check
in code
Get
feedback
Run
checks
Glue
• Amazon CloudWatch Events
• AWS Lambda
• Slack integration
• SNS (E-mail / Texts)
• Any AWS Service
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Fully managed Git service
• Hosts private Git repositories
• Backed by S3
• Scale with ease
• Store anything, anytime
AWS CodeCommit
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CodeCommit
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Code* Console - NEW LOOK
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeCommit
Repository
- Code
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CodeCommit - Visualizer
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CodeCommit – Pull Request
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CodeCommit
PR comments:
• Pull Request
• Line
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CodeCommit – notifications
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CodeCommit – notification/trigger
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Fully managed build service
• Continuous scaling
• Pay as you go
• Extensible
AWS CodeBuild
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Build source from CodeCommit, S3,
Bitbucket and GitHub/GitHub Enterprise
• Webhook support
• Multiple input repos and output artifacts
• Build inside your VPC
• Use secrets from Amazon Parameter Store
• S3 build cache
• Debug locally with CodeBuild Agent
AWS CodeBuild: Features
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Ubuntu
o .NET Core
o Android
o Docker
o Golang
o Java
o Node
o PHP
o Python
o Ruby
AWS CodeBuild: Supported Environments
• Windows Server 2016
o .NET Framework
o .NET Core
o C#
o F#
o Visual Basic
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeBuild Project
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeBuild Project Details
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeBuild Project Environment
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeBuild Build history
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeBuild Build status
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeBuild Phase details
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeBuild Logs
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeBuild Logs – Streamed to CB & CW
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
version: 0.2
phases:
install:
commands:
- npm install
build:
commands:
- npm test
artifacts:
files:
- '**/*'
AWS CodeBuild build spec
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Phase Description Examples
install Installation of packages into
the environment
Install testing
frameworks e.g.
RSpec, Mocha
pre_build Commands to run before the
build such as login steps or
installation of dependencies
Log in to Amazon
ECR. run Ruby
bundler or npm
build Sequence to run the build such
as compilation and/or running
tests
Run go build, sbt,
Mocha, RSpec
post_build Commands to run after a build
on success or failure
Build a JAR via Maven
or push a Docker
image to Amazon ECR
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CodeBuild build spec for Docker
version: 0.2
phases:
pre_build:
commands:
- $(aws ecr get-login --no-include-email)
- TAG="$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | head -c 8)"
- IMAGE_URI="${REPOSITORY_URI}:${TAG}"
build:
commands:
- docker build --tag "$IMAGE_URI" .
post_build:
commands:
- docker push "$IMAGE_URI"
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeBuild Metrics
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CodeCommit – CW Events
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The continuous integration journey
10 mph 65 mph 150 mph
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The continuous integration journey
Nightly
checks
Branch
checks
Pull request
checks
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Technique #1: Nightly checks
1. Nightly checks
2. Branch checks
3. Pull request checks
Run a full build
and unit tests
every night to
make sure that
application still
compiles and that
tests still pass.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Technique #2: Branch checks
1. Nightly checks
2. Branch checks
3. Pull request checks
Run a full build
and unit tests
every time
someone pushes a
new change to a
branch in the
source code repo.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Technique #3: Pull request checks
1. Nightly checks
2. Branch checks
3. Pull request checks
Run a full build
and unit tests
every time
someone creates a
pull request to get
code reviewed by
the team.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Nightly checks: How to implement
CloudWatch
Event
Schedule
Trigger
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CodeBuild triggers
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Automate codebase maintenance
2. Email notifications
Nightly checks: Speed boosts
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Nightly checks: Automate upgrades
CloudWatch
Event
Schedule
Trigger Push
Upgrade
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
- rm npm-shrinkwrap.json
- npm install
- npm test
- npm shrinkwrap
- git add npm-shrinkwrap.json
- git commit –m “Update dependencies!”
- git push
Nightly checks: Automate upgrades
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Nightly Checks: Update Libraries
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Nightly Checks: Update Libraries
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Nightly Checks: Update Libraries
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Automate codebase maintenance
2. Email notifications
Nightly checks: Speed boosts
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Speed boost: Email notifications
CloudWatch
Event
SendNotify
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Nightly checks summary
Implement: Run a build every night at midnight
Feedback loop: 16-24 hours
Team impact: Broken code can block team for entire days
Speed boosts: Automate codebase maintenance; Email notifications
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Technique #2: Branch checks
1. Nightly checks
2. Branch checks
3. Pull request checks
Run a full build
and unit tests
every time
someone pushes a
new change to a
branch in the
source code repo.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Branch checks: AWS CodeCommit
Push Notify Start
CloudWatch
Event
Team Members
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Branch Checks: CodeCommit Events
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Branch Checks: CodeCommit Events
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Branch Checks: CodeCommit Events
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Branch Checks: CodeCommit Events
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Branch Checks: CodeCommit Events
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Slack notifications
2. Build badges
3. Caching
Branch checks: Speed boosts
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Speed boost: Slack notifications
Notify
CloudWatch
Event
PostTrigger
Slack
Channel
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Branch Checks: Slack Notifications
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Branch Checks: Slack Notifications
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Slack notifications
2. Build badges
3. Caching
Branch checks: Speed boosts
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Slack notifications
2. Build badges
3. Caching
Branch checks: Speed boosts
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Speed boost: Caching
Update
Install
Amazon S3
Bucket
Download
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
cache:
paths:
- 'node_modules/**/*'
Speed boost: Caching
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeBuild timing w/o cache
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeBuild timing with cache
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Branch checks summary
Implement: Run a build every time new code is pushed to a branch
Feedback loop: Time it takes to build the code (minimum)
Team impact: Much shorter cycles; broken code still blocks team
Speed boosts: Slack notifications; build badges; caching
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Technique #3: Pull request checks
1. Nightly checks
2. Branch checks
3. Pull request checks
Run a full build
and unit tests
every time
someone creates a
pull request to get
code reviewed by
the team.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
PR checks: AWS CodeCommit
Propose
Notify Start
CloudWatch
Event
NotifyComment
Team Members
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Integration tests
2. Parallel builds
PR checks: Speed boosts
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Speed boost: Integration tests
Test
ElasticCache
Cluster
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Integration tests
2. Parallel builds
PR checks: Speed boosts
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Speed boost: Parallel builds
StartPropose
Multiple
CodeBuilds
Team Members
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Pull request checks summary
Implement: Run a build while code is still in review
Feedback loop: Time it takes to build the code
Team impact: Broken code doesn’t block the team
Speed boosts: Integration tests; parallel builds
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1.Automate the boring stuff
Library upgrades or automatic tagging
2.Communicate status
Email, Slack, build badges
3.Build faster
Caching, parallel builds
4.Check more
Unit and Integration tests
Continuous Integration
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The continuous integration journey
Developer
Shared codebaseAutomated checks
Check
in code
Get
feedback
Run
checks
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Samples
https://github.com/aws-samples/aws-codebuild-
samples
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Nick Brandaleone Joseph Vusich
nbrand@amazon.com
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

SRV322 Increase the Value of Video with ML & Media Services
 SRV322 Increase the Value of Video with ML & Media Services SRV322 Increase the Value of Video with ML & Media Services
SRV322 Increase the Value of Video with ML & Media Services
 
Security & Compliance for Modern Serverless Applications (SRV319-R1) - AWS re...
Security & Compliance for Modern Serverless Applications (SRV319-R1) - AWS re...Security & Compliance for Modern Serverless Applications (SRV319-R1) - AWS re...
Security & Compliance for Modern Serverless Applications (SRV319-R1) - AWS re...
 
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
Another Week, Another Million Containers on Amazon EC2 (CMP376) - AWS re:Inve...
 
Set Up Compliance Automation Using AWS Management Tools (SEC317) - AWS re:Inv...
Set Up Compliance Automation Using AWS Management Tools (SEC317) - AWS re:Inv...Set Up Compliance Automation Using AWS Management Tools (SEC317) - AWS re:Inv...
Set Up Compliance Automation Using AWS Management Tools (SEC317) - AWS re:Inv...
 
Petabyte-Scale Migration to Amazon S3 Building Photobox's Data Lake (STG393) ...
Petabyte-Scale Migration to Amazon S3 Building Photobox's Data Lake (STG393) ...Petabyte-Scale Migration to Amazon S3 Building Photobox's Data Lake (STG393) ...
Petabyte-Scale Migration to Amazon S3 Building Photobox's Data Lake (STG393) ...
 
Moving to DevOps the Amazon Way (DEV210-R1) - AWS re:Invent 2018
Moving to DevOps the Amazon Way (DEV210-R1) - AWS re:Invent 2018Moving to DevOps the Amazon Way (DEV210-R1) - AWS re:Invent 2018
Moving to DevOps the Amazon Way (DEV210-R1) - AWS re:Invent 2018
 
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
 
ProTips for Scaling AWS Training to Accelerate Adoption (DVC203) - AWS re:Inv...
ProTips for Scaling AWS Training to Accelerate Adoption (DVC203) - AWS re:Inv...ProTips for Scaling AWS Training to Accelerate Adoption (DVC203) - AWS re:Inv...
ProTips for Scaling AWS Training to Accelerate Adoption (DVC203) - AWS re:Inv...
 
Lessons Learned from Building an AWS Service on AWS Lambda (SRV327-R1) - AWS ...
Lessons Learned from Building an AWS Service on AWS Lambda (SRV327-R1) - AWS ...Lessons Learned from Building an AWS Service on AWS Lambda (SRV327-R1) - AWS ...
Lessons Learned from Building an AWS Service on AWS Lambda (SRV327-R1) - AWS ...
 
SRV207 Orchestrating AWS Lambda with Step Functions
 SRV207 Orchestrating AWS Lambda with Step Functions SRV207 Orchestrating AWS Lambda with Step Functions
SRV207 Orchestrating AWS Lambda with Step Functions
 
AWS Storage Leadership Session: What's New in Amazon S3, Amazon EFS, Amazon E...
AWS Storage Leadership Session: What's New in Amazon S3, Amazon EFS, Amazon E...AWS Storage Leadership Session: What's New in Amazon S3, Amazon EFS, Amazon E...
AWS Storage Leadership Session: What's New in Amazon S3, Amazon EFS, Amazon E...
 
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
The Future of Enterprise Applications is Serverless (ENT314-R1) - AWS re:Inve...
 
Deep dive - AWS Fargate
Deep dive - AWS FargateDeep dive - AWS Fargate
Deep dive - AWS Fargate
 
SRV328 Designing and Implementing a Serverless Media-Processing Workflow
SRV328 Designing and Implementing a Serverless Media-Processing WorkflowSRV328 Designing and Implementing a Serverless Media-Processing Workflow
SRV328 Designing and Implementing a Serverless Media-Processing Workflow
 
Deploy Alexa for Business in Your Organization & Build Your First Private Ski...
Deploy Alexa for Business in Your Organization & Build Your First Private Ski...Deploy Alexa for Business in Your Organization & Build Your First Private Ski...
Deploy Alexa for Business in Your Organization & Build Your First Private Ski...
 
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
 
Building Real-time Serverless Backends
Building Real-time Serverless BackendsBuilding Real-time Serverless Backends
Building Real-time Serverless Backends
 
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
 
A Few Milliseconds in the Life of an HTTP Request (CTD416) - AWS re:Invent 2018
A Few Milliseconds in the Life of an HTTP Request (CTD416) - AWS re:Invent 2018A Few Milliseconds in the Life of an HTTP Request (CTD416) - AWS re:Invent 2018
A Few Milliseconds in the Life of an HTTP Request (CTD416) - AWS re:Invent 2018
 
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
使用 AWS Step Functions 靈活調度 AWS Lambda (Level:200)
 

Semelhante a Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018

Semelhante a Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018 (20)

Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & Delivery
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & Delivery
 
Continuous Integration Best Practices for Software Development Teams - AWS On...
Continuous Integration Best Practices for Software Development Teams - AWS On...Continuous Integration Best Practices for Software Development Teams - AWS On...
Continuous Integration Best Practices for Software Development Teams - AWS On...
 
CI/CD pipelines on AWS - Builders Day Israel
CI/CD pipelines on AWS - Builders Day IsraelCI/CD pipelines on AWS - Builders Day Israel
CI/CD pipelines on AWS - Builders Day Israel
 
DevOps Culture at Amazon
DevOps Culture at AmazonDevOps Culture at Amazon
DevOps Culture at Amazon
 
Amazon CI/CD Practices for Software Development Teams - SRV320 - Anaheim AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Anaheim AWS ...Amazon CI/CD Practices for Software Development Teams - SRV320 - Anaheim AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Anaheim AWS ...
 
Amazon CI/CD Practices for Software Development Teams - SRV320 - Chicago AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Chicago AWS ...Amazon CI/CD Practices for Software Development Teams - SRV320 - Chicago AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Chicago AWS ...
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation Slides
 
Amazon CI/CD Practices for Software Development Teams - SRV320 - Atlanta AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Atlanta AWS ...Amazon CI/CD Practices for Software Development Teams - SRV320 - Atlanta AWS ...
Amazon CI/CD Practices for Software Development Teams - SRV320 - Atlanta AWS ...
 
DevOps on AWS
DevOps on AWSDevOps on AWS
DevOps on AWS
 
Community day _aws_ci_cd_v0.2
Community day _aws_ci_cd_v0.2Community day _aws_ci_cd_v0.2
Community day _aws_ci_cd_v0.2
 
CI/CD@Scale
CI/CD@ScaleCI/CD@Scale
CI/CD@Scale
 
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsA Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
 
Webinar-DevOps.pdf
Webinar-DevOps.pdfWebinar-DevOps.pdf
Webinar-DevOps.pdf
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & Delivery
 
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
 
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...
CI/CD Pipeline Security: Advanced Continuous Delivery Best Practices: Securit...
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and Fargate
 
CI/CD Pipeline Security: Advanced Continuous Delivery Recommendations
CI/CD Pipeline Security: Advanced Continuous Delivery RecommendationsCI/CD Pipeline Security: Advanced Continuous Delivery Recommendations
CI/CD Pipeline Security: Advanced Continuous Delivery Recommendations
 
DEV322_Continuous Integration Best Practices for Software Development Teams
DEV322_Continuous Integration Best Practices for Software Development TeamsDEV322_Continuous Integration Best Practices for Software Development Teams
DEV322_Continuous Integration Best Practices for Software Development Teams
 

Mais de Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Mais de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Continuous Integration Best Practices (DEV319-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Continuous Integration Best Practices Nick Brandaleone Joseph Vusich Senior Solutions Architect Senior Software Development Engineer AWS AWS D E V 3 1 9
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda Introduction to Continuous Integration Continuous Integration Tooling CI best practices and techniques Demo Review
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Breakout repeats DEV319 - Continuous Integration Best Practices Monday, Nov 26, 4:00 PM - 5:00 PM Venetian, Level 2, Titian 2204 DEV319 - Continuous Integration Best Practices Tuesday, Nov 27, 3:15 PM - 4:15 PM Venetian, Level 5, Palazzo O
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Related breakouts DEV317 - Advanced Continuous Delivery Best Practices Monday, Nov 26, 1:45 PM - 2:45 PM Tuesday, Nov 27, 2:30 PM - 3:30 PM Venetian, Level 5, Palazzo O. Aria East, Level 1, Joshua 9 DEV309 - CI/CD for Serverless and Containerized Applications Tuesday, Nov 27, 7:00 PM - 8:00 PM. Thursday, Nov 29, 2:30 PM - 3:30 PM Venetian, Level 2, Venetian E. Bellagio, Level 1, Grand Ballroom 2 Thursday, November 29 Leadership Session: Using DevOps, Microservices, and Serverless to Accelerate Innovation (SRV325) 12:15 – 1:15 PM | Venetian Theatre (Level 2)
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 7. “Continuous Integration is a software development practice where members of a team integrate frequently … verified by an automatic build and test process…” Martin Fowler
  • 8. “Continuous Integration produces and validates artifacts, while Continuous Deployment deploys them.”
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is continuous integration? 1. Developers regularly check in code to a shared, central repository 2. Automated checks run regularly against the shared codebase 3. Developers get feedback from the automated checks about their code Developer Shared codebaseAutomated checks Check in code Get feedback Run checks
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is continuous integration? 1. Developers regularly check in code to a shared, central repository 2. Automated checks run regularly against the shared codebase 3. Developers get feedback from the automated checks about their code Developer Shared codebaseAutomated checks Check in code Get feedback Run checks
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is continuous integration? 1. Developers regularly check in code to a shared, central repository 2. Automated checks run regularly against the shared codebase 3. Developers get feedback from the automated checks about their code Developer Shared codebaseAutomated checks Check in code Get feedback Run checks
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is continuous integration? 1. Developers regularly check in code to a shared, central repository 2. Automated checks run regularly against the shared codebase 3. Developers get feedback from the automated checks about their code Developer Shared codebaseAutomated checks Check in code Get feedback Run checks
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Typical Developer workflow 1) Write code - Cloud9 2) Compile and run unit tests locally - CodeBuild Local 3) Push code to a Git repository - CodeCommit 4) Build the updated images - CodeBuild 5) Run integration tests against new code - CodeBuild 6) Push new images to registry - CodeBuild and Elastic Container Registry 7) Trigger a deployment - CodeBuild or CloudWatch Events + Lambda
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why does continuous integration matter? • Find bugs earlier • Fix bugs faster • Deliver faster • Deliver more often • Unblock developers • Grow developers
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why does continuous integration matter? • Find bugs earlier • Fix bugs faster • Deliver faster • Deliver more often • Unblock developers • Grow developers Quality: 5x lower change failure rate Source: 2017 State of DevOps Report (Puppet)
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why does continuous integration matter? • Find bugs earlier • Fix bugs faster • Deliver faster • Deliver more often • Unblock developers • Grow developers Delivery: 440x faster from commit to deploy Source: 2017 State of DevOps Report (Puppet)
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why does continuous integration matter? • Find bugs earlier • Fix bugs faster • Deliver faster • Deliver more often • Unblock developers • Grow developers Delivery: 46x more frequent deployments Source: 2017 State of DevOps Report (Puppet)
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why does continuous integration matter? • Find bugs earlier • Fix bugs faster • Deliver faster • Deliver more often • Unblock developers • Grow skills faster Happy teams: 44% more time spent on new features and code Source: 2017 State of DevOps Report (Puppet)
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Teams that practice CI/CD ship more code faster, and with more confidence 5x Lower change failure rate 440x Faster from commit to deploy 46x More frequent deployments 44% More time spent on new features Source: Puppet 2017 State of DevOps Report
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Summary
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Continuous integration tools Developer Shared codebaseAutomated checks Check in code Get feedback Run checks Source Code • AWS CodeCommit • GitHub • GitHub Enterprise • Bitbucket • S3
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Continuous integration tools Developer Shared codebaseAutomated checks Check in code Get feedback Run checks Build & Test • AWS CodeBuild • Jenkins w/ CodeBuild
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Continuous integration tools Developer Shared codebaseAutomated checks Check in code Get feedback Run checks Glue • Amazon CloudWatch Events • AWS Lambda • Slack integration • SNS (E-mail / Texts) • Any AWS Service
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Fully managed Git service • Hosts private Git repositories • Backed by S3 • Scale with ease • Store anything, anytime AWS CodeCommit
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CodeCommit
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Code* Console - NEW LOOK
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeCommit Repository - Code
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CodeCommit - Visualizer
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CodeCommit – Pull Request
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CodeCommit PR comments: • Pull Request • Line
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CodeCommit – notifications
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CodeCommit – notification/trigger
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Fully managed build service • Continuous scaling • Pay as you go • Extensible AWS CodeBuild
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Build source from CodeCommit, S3, Bitbucket and GitHub/GitHub Enterprise • Webhook support • Multiple input repos and output artifacts • Build inside your VPC • Use secrets from Amazon Parameter Store • S3 build cache • Debug locally with CodeBuild Agent AWS CodeBuild: Features
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Ubuntu o .NET Core o Android o Docker o Golang o Java o Node o PHP o Python o Ruby AWS CodeBuild: Supported Environments • Windows Server 2016 o .NET Framework o .NET Core o C# o F# o Visual Basic
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeBuild Project
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeBuild Project Details
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeBuild Project Environment
  • 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeBuild Build history
  • 43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeBuild Build status
  • 44. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeBuild Phase details
  • 45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeBuild Logs
  • 46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeBuild Logs – Streamed to CB & CW
  • 47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. version: 0.2 phases: install: commands: - npm install build: commands: - npm test artifacts: files: - '**/*' AWS CodeBuild build spec
  • 48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Phase Description Examples install Installation of packages into the environment Install testing frameworks e.g. RSpec, Mocha pre_build Commands to run before the build such as login steps or installation of dependencies Log in to Amazon ECR. run Ruby bundler or npm build Sequence to run the build such as compilation and/or running tests Run go build, sbt, Mocha, RSpec post_build Commands to run after a build on success or failure Build a JAR via Maven or push a Docker image to Amazon ECR
  • 49. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CodeBuild build spec for Docker version: 0.2 phases: pre_build: commands: - $(aws ecr get-login --no-include-email) - TAG="$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | head -c 8)" - IMAGE_URI="${REPOSITORY_URI}:${TAG}" build: commands: - docker build --tag "$IMAGE_URI" . post_build: commands: - docker push "$IMAGE_URI"
  • 50. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeBuild Metrics
  • 51. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CodeCommit – CW Events
  • 52. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 53. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The continuous integration journey 10 mph 65 mph 150 mph
  • 54. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The continuous integration journey Nightly checks Branch checks Pull request checks
  • 55. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Technique #1: Nightly checks 1. Nightly checks 2. Branch checks 3. Pull request checks Run a full build and unit tests every night to make sure that application still compiles and that tests still pass.
  • 56. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Technique #2: Branch checks 1. Nightly checks 2. Branch checks 3. Pull request checks Run a full build and unit tests every time someone pushes a new change to a branch in the source code repo.
  • 57. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Technique #3: Pull request checks 1. Nightly checks 2. Branch checks 3. Pull request checks Run a full build and unit tests every time someone creates a pull request to get code reviewed by the team.
  • 58. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Nightly checks: How to implement CloudWatch Event Schedule Trigger
  • 59. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CodeBuild triggers
  • 60. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 61. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 62. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. Automate codebase maintenance 2. Email notifications Nightly checks: Speed boosts
  • 63. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Nightly checks: Automate upgrades CloudWatch Event Schedule Trigger Push Upgrade
  • 64. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. - rm npm-shrinkwrap.json - npm install - npm test - npm shrinkwrap - git add npm-shrinkwrap.json - git commit –m “Update dependencies!” - git push Nightly checks: Automate upgrades
  • 65. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Nightly Checks: Update Libraries
  • 66. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Nightly Checks: Update Libraries
  • 67. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Nightly Checks: Update Libraries
  • 68. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. Automate codebase maintenance 2. Email notifications Nightly checks: Speed boosts
  • 69. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Speed boost: Email notifications CloudWatch Event SendNotify
  • 70. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 71. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 72. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Nightly checks summary Implement: Run a build every night at midnight Feedback loop: 16-24 hours Team impact: Broken code can block team for entire days Speed boosts: Automate codebase maintenance; Email notifications
  • 73. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Technique #2: Branch checks 1. Nightly checks 2. Branch checks 3. Pull request checks Run a full build and unit tests every time someone pushes a new change to a branch in the source code repo.
  • 74. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Branch checks: AWS CodeCommit Push Notify Start CloudWatch Event Team Members
  • 75. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Branch Checks: CodeCommit Events
  • 76. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Branch Checks: CodeCommit Events
  • 77. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Branch Checks: CodeCommit Events
  • 78. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Branch Checks: CodeCommit Events
  • 79. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Branch Checks: CodeCommit Events
  • 80. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. Slack notifications 2. Build badges 3. Caching Branch checks: Speed boosts
  • 81. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Speed boost: Slack notifications Notify CloudWatch Event PostTrigger Slack Channel
  • 82. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Branch Checks: Slack Notifications
  • 83. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Branch Checks: Slack Notifications
  • 84. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. Slack notifications 2. Build badges 3. Caching Branch checks: Speed boosts
  • 85. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 86. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 87. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. Slack notifications 2. Build badges 3. Caching Branch checks: Speed boosts
  • 88. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Speed boost: Caching Update Install Amazon S3 Bucket Download
  • 89. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. cache: paths: - 'node_modules/**/*' Speed boost: Caching
  • 90. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 91. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeBuild timing w/o cache
  • 92. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CodeBuild timing with cache
  • 93. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Branch checks summary Implement: Run a build every time new code is pushed to a branch Feedback loop: Time it takes to build the code (minimum) Team impact: Much shorter cycles; broken code still blocks team Speed boosts: Slack notifications; build badges; caching
  • 94. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Technique #3: Pull request checks 1. Nightly checks 2. Branch checks 3. Pull request checks Run a full build and unit tests every time someone creates a pull request to get code reviewed by the team.
  • 95. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. PR checks: AWS CodeCommit Propose Notify Start CloudWatch Event NotifyComment Team Members
  • 96. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 97. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 98. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 99. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 100. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 101. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 102. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. Integration tests 2. Parallel builds PR checks: Speed boosts
  • 103. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Speed boost: Integration tests Test ElasticCache Cluster
  • 104. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 105. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 106. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. Integration tests 2. Parallel builds PR checks: Speed boosts
  • 107. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Speed boost: Parallel builds StartPropose Multiple CodeBuilds Team Members
  • 108. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 109. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Pull request checks summary Implement: Run a build while code is still in review Feedback loop: Time it takes to build the code Team impact: Broken code doesn’t block the team Speed boosts: Integration tests; parallel builds
  • 110. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 111. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 112. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1.Automate the boring stuff Library upgrades or automatic tagging 2.Communicate status Email, Slack, build badges 3.Build faster Caching, parallel builds 4.Check more Unit and Integration tests Continuous Integration
  • 113. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The continuous integration journey Developer Shared codebaseAutomated checks Check in code Get feedback Run checks
  • 114. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Samples https://github.com/aws-samples/aws-codebuild- samples
  • 115. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Nick Brandaleone Joseph Vusich nbrand@amazon.com
  • 116. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.