build and deployment with jenkins and code deploy on aws

14
Build and Deployment with Jenkins and Code Deploy on AWS -Mitesh Sharma

Upload: miteshsharma

Post on 08-Apr-2017

205 views

Category:

Internet


3 download

TRANSCRIPT

Page 1: Build and deployment with Jenkins and Code Deploy on AWS

Build and Deploymentwith Jenkins and Code Deploy

on AWS

-Mitesh Sharma

Page 2: Build and deployment with Jenkins and Code Deploy on AWS

Build And Deployment

AWS EC2 Server

Build, Test, Deploy

Find issues, fix them, Add features

Dev Machine

Page 3: Build and deployment with Jenkins and Code Deploy on AWS

Build And Deployment

AWS EC2 ServerDev Machine

Build SCP from dev to server Deploy

Page 4: Build and deployment with Jenkins and Code Deploy on AWS

Build And Deployment

AWS EC2 ServerDev Machine

Build Deploy

Page 5: Build and deployment with Jenkins and Code Deploy on AWS

Build And Deployment

Trigger Build and deploy

AWS EC2 ServerDev Machine

Deploy

Code Push

Page 6: Build and deployment with Jenkins and Code Deploy on AWS

Build And Deployment with CodeDeploy

Trigger Build and deploy

AWS EC2 ServerDev Machine

Deployed

Code Push

+AWS

CodeDeploy

Page 7: Build and deployment with Jenkins and Code Deploy on AWS

AWS Code Deploy: What we needAmazon EC2 with CodeDeploy Agent

Amazon S3

AWS CodeDeploy

Page 8: Build and deployment with Jenkins and Code Deploy on AWS

AWS Code DeployGetting ready:

Assign proper roles and permissions both to AWS CodeDeploy and EC2

Tag the instance where we want to do deployment

Install agent if not using AMI which already have oneCreate Application Specify Deployment

GroupSpecify Deployment

Configration Upload Revision

DeployCheck Result

Page 9: Build and deployment with Jenkins and Code Deploy on AWS

Life Cycle EventsAgent goes through series of events

Steps allow us to control application development

For example: We can close application cleanly using these steps.

AppSpec.yml sits in application’s source directory which allows us to define hooks

AWS Code Deploy

ApplicationStop

BeforeInstall

AfterInstall

ApplicationStart

ValidateService

Agent

Start

Download Bundle

Install

End

Page 10: Build and deployment with Jenkins and Code Deploy on AWS

Jenkins Machine

Content+

AppSpec.yml

EC2 Machine

Amazon S3 / Github can be used

CodeDeploy

Deployment Management

Content+

AppSpec.yml

Deployment Group

Agent Agent

Agent Agent

Agent Agent

1

2 3

4

AWS Code Deploy

Page 11: Build and deployment with Jenkins and Code Deploy on AWS

IssuesBuild and deployment at same place restrict us from deploying same

build on multiple environments

Need to build multiple times for each environment

Code pushes can happen between different builds for deployment on different environment

Build and deployment needs to be decoupled

Page 12: Build and deployment with Jenkins and Code Deploy on AWS

Jenkins Machine

Content with env conf withAppSpec.yml

EC2 Machine

Amazon S3 /

Github can be used

CodeDeploy

Deployment Management

Content+

AppSpec.yml

Deployment Group

Agent Agent

Agent Agent

Agent Agent

1

2 3

4

AWS Code Deploy

Jenkins Machine

Build

Page 13: Build and deployment with Jenkins and Code Deploy on AWS

Demo

Page 14: Build and deployment with Jenkins and Code Deploy on AWS

ThanksTwitter : @mitesh_shamraGithub : https://github.com/MiteshSharma