Skip to content

KobeVK/CI-CD-Home-assignment

Repository files navigation

Versatile

DevOps Engineer Home Challenge for @Versatile

Project purpose

DevOps Engineer Home Challenge for @Versatile As part of this Home assignment, I was required to create a web-app that returns Hello, , deploy it automatically, test and create useful CI flow.

important notes:

  1. Engineers cannot deploy to same enviorment
    This was done by using GIT to manage my Terraform code. It allows me to track changes to your code and manage conflicts one build at a time.
  2. Links can be seen throughout the Jenkins jobs run
    2.1 deployed web app
    2.2 docker image
  3. Emails on failed test

Architecture

Versatile web app CI diagram


Versatile web app CICD flow involves the following stages:

  1. Deploy
    In this stage, we deploy an EC2 instance to aws, using terraform aws module
  2. verify
    In this stage, we verify that the EC2 instance was created succesfully
  3. Install
    In this stage, we install our web application on top of the EC2 using ansible whcih runs docker-compose to initiate a docker container that holds our web app
  4. Test
    In this stage, we test the functionality of the web-app
    such as:
    4.1 Health Checks 4.2 Health Checks 4.3 Health Checks
  5. Release
    In this stage, we release the image as artifact to dockerhub.
    This image containes the latest of our code
  6. Destroy
    On development branches only (pipelines that came from any other branch but main) the pipeline will kill the EC2 machine that was created after 10 minuets

as for production, the

Deployment

To deploy development enviornemt:

  1. Login to jenkins in http://13.38.117.100:8080/job/versatile-app-build-test-deploy/
  2. Go to versatile-app-build-test-deploy job
  3. Press on your development branch
  4. Build with Parameters
  5. set Region and 'build'

Deployment to production will happen only after a succesful merge to main branch

Deploy locally (installing web-app only)

pre-requisites:
    docker | docker-compose | python | virtualenv | pip | git

git clone clone https://github.com/KobeVK/Versatile
cd Versatile && docker-compose up

The tests

  1. health check

Artifacts

The product is the web-app containerized and pushed to docker hub. auto versioned by the Jenkins job number
https://hub.docker.com/r/sapkobisap/versatile

Future work

  1. Enable more parameters in Gitlab to support wider range of deployemt possibilites (not just free-tier EC2's)
  2. Fix folder structure to better visibility (ansible files, TF files, Docker files)
  3. add proxy such as NginX
  4. Infrastructure tests (Load on server, high traffic, etc...)
  5. add Python unit tests, (maybe mock's with pupeteer...)

About

DevOps Engineer Home Challenge for @Versatile

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published