Join me here :

http://tiny.cc/awscicd

Mohamed BOUCHENAFA

DevOps - AWS Lead Consultant

Join me here :

http://tiny.cc/awscicd

DEVOPS : Build youR CI/CD USING

AWS Code* SERVICES

  • DEVOPS & CI/CD

  • CODE SERVICES

    • Control your code

    • Build your BUILDS

    • DEPLOY YOUR APPS

    • MANAGE YOUR CI/CD WORKFLOW

DEVOPS FIGURES

Deploy more often

46x

Source: Puppet 2017 State of DevOps Report

440x

Faster changes

Recover

96x faster

 Failures changes 5x lower

-21%

less time spent on unplanned work and rework

+44%

more time for new features

Is DEVOPS IMPORTANT ?

Software LiFECYCLE

DevOps = more efficient lifecycle

Developers

Customers

Delivery Pipeline

Feeback Loop

AWS DEVOPS TOOLS

CodeCommit

CodeBuild

CodeDeploy

CodePipeline

CodeStar

CloudFormation

OpsWork

XRay

CloudWatch

CloudTrail

Config

CI/CD

Infrastructure as Code

Logging/Monitoring

CI/CD

CodeCommit

CodeBuild

CodeDeploy

CodePipeline

CodeStar

CI/CD

Secure

Fully Managed

High availability

Store

anything

Source control in the Cloud

  • Use standard Git tools
  • Secure, scalable, and managed Git source control
  • Encryption at rest with customer-specific keys
  • No repo size limit
  • Post commit hooks to call out to Amazon SNS or Lambda
  • $1 per active user per month (first five users free)

AWS CodeCommit

AWS CODECOMMIT

git push

HTTPS or SSH

CodeCommit

Git objects is S3

Git index in DynamoDB

Enkryption keys in KMS

AWS CODEBUILD

  • Fully managed service to build apps
  • Scales continuously and processes multiple builds concurrently

  • Customization via Docker images
  • Pay by the minute for the compute resources you use
  • AWS CodePipeline and Jenkins integration

How does it work

Get source

Execute spec steps

Streams output

Store

Artefact

BUILDSPEC.YML

version: 0.1
environment_variables: plaintext:
JAVA_HOME: "/usr/lib/jvm/java-8-openjdk-amd64"
phases:
  install:
    commands:
     - apt-get update -y
     - apt-get install -y maven
  pre_build:
    commands:
     - echo Nothing to do in the pre_build phase...
  build:
    commands:
     - echo Build started on `date`
     - mvn install
post_build:
    commands:
     - echo Build completed on `date`
  artifacts:
    type: zip
    files:
      - target/messageUtil-1.0.jar discard-paths: yes 

AWS CODEBUILD - DETAILS

Source

Runtime

Compute type

OS

3 GB memory, 2 vCPU

7 GB memory, 4 vCPU

15 GB memory, 8 vCPU

AWS CODEDEPLOY

  • Automates your apps  deployments to any instance
  • Handles the complexity of updating your applications
  • Avoid downtime during application deployment
  • Rollback automatically if failure detected
  • Deploy to Amazon EC2 or on-premises servers, in any language and on any operating system
  • Integrates with third-party tools and AWS
  • Free for  EC2 - $0.02 per update to on-premises server

AppSPEC.YML

version: 0.0
os: linux
files:
  - source: /target/SampleMavenTomcatApp.war
    destination: /tmp/codedeploy-deployment-staging-area/
  - source: /scripts/configure_http_port.xsl
    destination: /tmp/codedeploy-deployment-staging-area/
hooks:
  ApplicationStop:
    - location: scripts/stop_application
      timeout: 300
  BeforeInstall:
    - location: scripts/install_dependencies
      timeout: 300
  ApplicationStart:
    - location: scripts/write_codedeploy_config.sh
    - location: scripts/start_application
      timeout: 300
  ValidateService:
    - location: scripts/basic_health_check.sh

WORKFlOW - AppSPEC.YML

TARGETS

Group instances by:

  • AutoScaling group
  • EC2 tag
  • On-premises tag

Deploy STRATEGIES

One-at-a-Time

Half-at-a-Time

All-at-Once

or Custom

In Place

or Blue/Green

AWS CodePIPELINE

  • Continuous delivery service for fast and reliable application updates
  • Model and visualize your software release process
  • Trigger any action on your code every time there is a code change
  • Integrates with third-party tools and AWS
  • $1 per active pipeline per month (first one free)

AWS CODEPIPELINE

Stage

Pipeline

Action

Transition

AWS CODEPIPELINE

Parallel actions

AWS CODEPIPELINE

Sequential actions

AWS CODEPIPELINE

Manual Approval

AWS CODEPIPELINE - Actions

Source 

Build

Deploy

Test

Approval

Invoke

AWS CODESTAR

  • A wide variety of project templates

  • Quickly setup  your CI / CD toolchain on AWS
  • Start developing on AWS in minutes

  • Work across your team, securely

  • Manage software delivery easily

  • Integrated issue tracking and project management
  • There is no additional charge for AWS CodeStar

AWS CODESTAR - EXAMPLE

AWS CODESTAR - DETAILS

Application

Languages

AWS services

AWS Config Rule

Web application

Web service

Alexa Skill

Static Website

Code Editor

DEMO #1

  • Simple Alexa Skill
  • Node JS Lambda

 

  • Code Change
  • Automatic CodePipeline Trigger
  • CodeBuild
  • Deploy with Cloudformation

DEMO #2

  • Simple Angular App

 

 

  • CodeBuild
  • Manual Approval CodePipeline
  • CodeDeploy
  • No install, No updates, No upgrade
  • No hardware provisioning
  • Compatible with a wide range of tools

Create VALUE

WRAP UP

Spend time on your software, not your
software factory

  • Gentle learning curve
  • Secure and Scalable