Giter Site home page Giter Site logo

mhussein27 / wm-devop Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 3.0 201 KB

The aim of the project is to Automate Machine/Environment Creation On Amazon Web Service , so you can make your Environment up or down in short time and with a few scripts.

Shell 100.00%

wm-devop's Introduction

Project Title: WM-DevOps

The aim of the project is to Automate Machine/Environment Creation On Amazon Web Service , so you can make your Environment up or down in short time and with a few scripts.

Introduction

We need to create the below machine , so we can build and deploy any App using a CI pipeline consisting of Docker, GitHub, Jenkins, and Docker Registry.

  • Bastion : Machine with ubuntu OS which hosts wm-devop folder with all DevOps Scripts. To make the Environment up ,all the Script should be run from there .

  • Jenkins : Machine with ubuntu OS for Continouse Integration /Continouse Delivery.

  • Registry: Machine with ubuntu OS to act as Docker Local Registry .

  • Swarm:(Node-1"Leader",Node-2"Worker",Node-3"Worker") : Machines with Rancher OS to act as Docker Swarm Cluster .

The following diagram illustrates the CI pipeline that "you need to configure by Yourself" after machine creation on AWS: The pipeline will be kicked off by a commit to a GitHub repository. The commit will cause Jenkins machine to run (3) build+push to Docker Registry Machine, and upon successful completion of these jobs, pull new images from DR and deploy the app on Swarm cluster using docker-compose. The following diagram illustrates the CI pipeline.

Prerequisites

What things you need to install the software and how to install them

1- Install the below tools locally on your Machine

How to run Scripts and Setup the Environment

A step by step that tell you How to get your env running

1- Generate the ssh key for your machine ,then Copy id_rsa.pub in wm-devop\ssh folder

	Run This Command (ssh-keygen) on your commandline ,the output will be generated by default in **<UserHome>/.ssh/id_rsa.pub**

2- Edit AWS-ENV-Config.sh with your AWS Account details (ex: AWS_ACCESS_KEY and AWS_SECRET_ACCESS_KEY)

3- Run only one time AWS-Volume.Sh: to Create Backup Volume for Jenkins machine.

4- Then Run This Script EntryPoint_ENVSetup.sh on your commandline , use Git Bash if you are in Windows

5- Open your AWS Consule , Then you should see the above Machines up and running in your EC2 Frankfurt region .

Scripts Description

  • AWS-ENV-Config.sh - This Scrpt will Export AWS Access & secret key and Region

  • EntryPoint_ENVSetup.sh - This Script will prepare the entry point to setup the Environment by doing the below:

  • ENVSetup.sh - This Script will Setup the Environment and Create Swarm ,Registry,Jenkins Machines

  • ENVShutdown.sh - This Script will Delete all the machine and it's security Group, except Bastion..please notice You need to run this Script from Bastion

  • AWS-Machine-Terminate.sh - This Script will Terminate any machine but it takes machine name as input in Shell

  • AWS-SG-Delete.sh - This Script will Delete any Security Group but it takes Security Group name as input in Shell

  • AWS-Volume.Sh - This Script will Create an EBS volume that can be attached to an instance in the same Availability Zone and Making an Amazon EBS Volume Available for Use. you need this Volume as Backup point not to lose your data after you terminate the machine

Notes :

1- You can Create SSH Key-Pair of your machine and the remote machines like Jenkis and Bastion and save them In wm-devop\ssh To Avoid Re-create Key-Pair each time you Re-create the machine after it's termination.

2- You don't need to create Bastion machine , for example : You Can create run This script DockerRegistry.sh directly to create only Docker Registry machine.

3- If you need to Setup Jenkins Machine Only <YOU NEED TO RUN THIS SCRIPT AWS-Volume.Sh Only one time> then you can run Jenkins.sh directly any time after that without any prerequists.

4- You can update the Variable section and Comment or un-comment any section in the scripts to match your requirements.

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Future Work

We need to use Ansible to do the same task.

Versioning

We can use SemVer for versioning.

Authors

list of [contributors]who participated in this project:

License

Acknowledgments

wm-devop's People

Contributors

mhussein27 avatar

Stargazers

Byt3 Ninja avatar Mohamed Abdelgaid avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.