DevOps Milestone - Deployment

Team :

Submission: Milestone#Deploy
Link To Sample Repository Used: WebGoat
Submission Files:

  • README.md

Public IP Addresses

All servers are hosted in AWS using EC2 service

  1. Master = 52.4.40.18
  2. Canary 1 (Blue) = 52.5.33.235
  3. Canary 2 (Green) = 52.5.15.126

Diagram ProjectPlan

Installations and AWS Settings

Install the following ON ALL THREE INSTANCES (master, canary1 and canary2) to achieve this Milestone

  1. Download and install salt
  2. Download and Install git
  3. ON ALL THREE INSTANCES (master, canary1 and canary2) allow all traffic option selected from security group in AWS

Make canary1 and canary2 remote repositories to master

The following steps should be followed to make canary1 and canary2 as remote repository of master

-- Steps for Master

  1. ssh to master using ssh -i Nikhil.pem ubuntu@52.4.40.18 where Nikhil.pem is the AWS key file attached with this submission

  2. Create a folder Proj@Master using mkdir

  3. Inside this folder initialize a bare repository using git init --bare

  4. Clone WebGoat repository inside this folder

  5. Transfer the key file Nikhil.pem to master from local using the command :

    scp -i Nikhil.pem Nikhil.pem ubuntu@52.4.40.18

  6. Generate ssh key at master and bind AWS key (Nikhil.pem) with this ssh key as follows

    ssh-keygen

    cat ~/.ssh/id_rsa.pub | ssh -i Nikhil.pem ubuntu@52.5.33.235 "cat >> .ssh/authorized_keys"

    cat ~/.ssh/id_rsa.pub | ssh -i Nikhil.pem ubuntu@52.5.15.126 "cat >> .ssh/authorized_keys"

  7. Bind this key with ssh command at master for authentication

    ssh-add Nikhil.pem

  8. Setup SSH at MASTER

$ ssh-add Nikhil.pem
  1. Add git remote
$ git remote add blue ssh://ubuntu@52.5.33.235/blue.git
$ git remote add green ssh://ubuntu@52.5.15.126/green.git

Setup remote git repo on canary1

Create a bare repository

$ mkdir blue.git
$ cd blue.git
$ git init --bare

Set GIT_WORK_TREE

$ mkdir /home/ubuntu/blue-www/
$ cat > hooks/post-receive
#!/bin/sh
GIT_WORK_TREE=/home/ubuntu/blue-www/ git checkout -f


Make post-receive executable:
$ chmod +x hooks/post-receive

Setup remote git repo on canary2

Create a bare repository

$ mkdir green.git
$ cd green.git
$ git init --bare

Set GIT_WORK_TREE

$ mkdir /home/ubuntu/green-www/
$ cat > hooks/post-receive
#!/bin/sh
GIT_WORK_TREE=/home/ubuntu/green-www/ git checkout -f


Make post-receive executable:
$ chmod +x hooks/post-receive

Evaluation

Milestone#Deploy is evaluated based on the following Evaluation Parameters:

  • Automatic deployment environment configuration: 20%

  • Deployment of binaries created by build step: 20%

  • Remote deployment: 20%

  • Canary releasing: 20%

  • Canary analysis: 20%