Slide 1

Slide 1 text

COMMUNITY DAY MENA DevOps on AWS, Getting Started

Slide 2

Slide 2 text

Farouq Mousa AWS Solutions Architect | DevOps Engineer | Genesys Consultant | AWS UG Leader at Palestine @farouqmousa @farouqmousa

Slide 3

Slide 3 text

Agenda ▪ AWS CodeDeploy ▪ AWS CodeBuild ▪ AWS CodePipeline

Slide 4

Slide 4 text

CodeDeploy AWS Native Continuous Delivery Tools CodeBuild CodePipeline

Slide 5

Slide 5 text

DevOps and Continuous Delivery • Automated deployments • Repeatable and safer • Smaller change sizes • Deploy morefrequently • Faster feedback loops • Learn and reactquicker • Deliver more value

Slide 6

Slide 6 text

CodeDeploy DEPLOYING APPS W I T H

Slide 7

Slide 7 text

Benefits of CodeDeploy • Automate yourdeployments • Fully managed serverlessservice • Free withinAWS • $0.02 per on-premises instanceupdate • Centralize control • Versatile

Slide 8

Slide 8 text

Application The core component CodeDeploy Components Deployment Group A target for your deployment Deployment Roll out anapp revision

Slide 9

Slide 9 text

Compute platform EC2/On-premises, AWS Lambda, Amazon ECS A uniquename An identifier that isunique inside its AWS account A CodeDeploy Application

Slide 10

Slide 10 text

ECS An ECS cluster + An ECS service + A load balancer + Target Group 1 + Target Group 2 Lambda Lambda function name EC2/On-premises Autoscaling groups EC2 instance tags On-premises hosts Deployment Groups

Slide 11

Slide 11 text

Deployment group Targets for the deployment A CodeDeploy Deployment Deployment configuration Such as “One At A Time” Revision An application version Deployment type “In Place” or “Blue-Green”

Slide 12

Slide 12 text

ECS AppSpec file Task Definition version Container name Container port Lambda AppSpec file Function name Function alias Version info EC2/On-premises GitHub commit ID or Zip file in S3 Revisions

Slide 13

Slide 13 text

version: 0.0 os: linux files: - source: /src destination: /var/www/html hooks: BeforeInstall: - location: scripts/before_install.sh timeout: 300 runas: root AppSpec File: appspec.yml

Slide 14

Slide 14 text

EC2 or on-premisesinstance Installing the CodeDeploy Agent codedeploy-agent EC2 User Data

Slide 15

Slide 15 text

#!/bin/bash -xe yum install -y ruby cd /opt curl -O https://aws-codedeploy-us-east- 1.s3.amazonaws.com/latest/install chmod +x ./install ./install auto Install CodeDeploy - Red Hat

Slide 16

Slide 16 text

CodeDeploy ELB EC2 Connecting All CodeDeploy Pieces IAM GitHub or S3 Revisions agent IAM

Slide 17

Slide 17 text

CodeBuild CONTINUOUS INTEGRATION W I T H

Slide 18

Slide 18 text

• Software licensing • CI software upgrades • Underlying host management • Agent configurations • Hand crafted build projects • Queued builds Traditional CI

Slide 19

Slide 19 text

Continuous Integration • DevOps and agile processes • Helps prevent merge conflicts • Triggers off code commits • Static code analysis • Compiles code • Runs tests • Packages and publishes artifacts • Catch and fix problems quicker

Slide 20

Slide 20 text

Continuous Integration Systems Managed services Master/agent Open Source andfree

Slide 21

Slide 21 text

Teamcity Bamboo Jenkins GitLab Travis CircleCI Alternatives to CodeBuild

Slide 22

Slide 22 text

Benefits of CodeBuild • Fully managed build service • Elastic scaling • Pay only for build time used • CLI and API driven • Define builds as code • Tightly knit AWS integrations • Extensible

Slide 23

Slide 23 text

Sends notifications Runs tests Static code analysis Compiles code Runs builds How Is CodeBuild Used in a CI/CD pipeline? 1 2 3 4 6 Publishes Artifacts 5

Slide 24

Slide 24 text

Build project The definition ofyour project Build or Build run An execution of your Build project CodeBuild Components

Slide 25

Slide 25 text

Metrics Build triggers Build details Build history Build Project

Slide 26

Slide 26 text

Environment Artifacts Project configuration Source Build Spec Logs CodeBuild Project Build Details

Slide 27

Slide 27 text

Build details Environment variables Phase details Build logs Build status Builds or Build Runs

Slide 28

Slide 28 text

CodeBuild Connecting All the Pieces Git repo orS3 Source Artifact store Projects Builds

Slide 29

Slide 29 text

version: 0.2 env: variables: key: “value” parameter-store: key: “value” phases: build: commands: - compile commands - test commands artifacts: files: - target/messageUtil-1.0.jar Build Spec File:buildspec.yml

Slide 30

Slide 30 text

Ruby Golang Python Java .NET PHP Testing Tools

Slide 31

Slide 31 text

CodePipeline AUTOMATING SOFTWARE RELEASES WITH

Slide 32

Slide 32 text

Continuous Delivery Pipelines • A Continuous Delivery tool • Define your entire release process • Ties together disparate systems • Flows Code out to production

Slide 33

Slide 33 text

Prerequisites for CodePipeline AW S account IAM credentials

Slide 34

Slide 34 text

Prerequisites for CodePipeline Source code Build process D eployment or

Slide 35

Slide 35 text

Benefits of CodePipeline • Fully managed pipeline service • Pay only for active pipelines • Tightly tightly AWS integrations • Third party developer tool actions • Extensible via Lambda and custom actions

Slide 36

Slide 36 text

Artifacts Bundles of code produced by astage and ingested by another stage Transitions The connections between stages Stages A collection of action groups that contain actions Pipeline Components

Slide 37

Slide 37 text

A CodePipeline Stage Action Group Actions Pipeline Stage Action Group Actions runOrder: 1 runOrder: 1 runOrder: 2 runOrder: 2

Slide 38

Slide 38 text

Visualizing CodePipeline Transition Source Stage Action Group G itHub action Build Stage Action Group C o deB uild action Deploy Stage Action Group C o deD eploy action Transition Pipeline

Slide 39

Slide 39 text

Test Action Approval Action Source Action Build Action Deploy Action Invoke Action Action Types

Slide 40

Slide 40 text

CloudWatch Events A configured rule can route CodePipeline event info to one or more targets CodeDeploy Triggers Publish to an S N S topic when deployment events occur for a deployment group Pipeline Execution Monitoring

Slide 41

Slide 41 text

Thank You ☺ @farouqmousa @farouqmousa