DEVOPS AUTOMATION

DEVOPS AUTOMATION


Introduction of applications used:

  1. Github : Github is a centralised system where we can upload or download the code .It is good example of SCM where we can store ,manage and roll-bcak our code.
  2. Docker : Docker is a container tool where we can setup OS just a second ,by downloading and configuring .It also works as a fast technique for deploying the code.
  3. Jenkins : Jenkins is used to build and test your software projects continuously. It will integrate the code easier.

Creating a repository in Github:

Create a repository and initialize it .

No alt text provided for this image

In Git Bash:

##creating local repo##

1.Cloning the github repo in GIT BASH.

2.POST-COMMIT : creating a notepad file for post commit

Why use post-commit? In Jenkins post-commit  are used to trigger the build whenever a developer commits something to the master branch.

Code:

#!/bin/bash

git push

3.Creating a branch (dev1)

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Jenkins:

  1. Creating Job1
No alt text provided for this image

and configuring the repo we made in git hub

No alt text provided for this image
No alt text provided for this image

Writing shell code to be run in RHEL 8:

if sudo docker ps | grep main_server

then

echo " Server is already running"

else 

sudo docker run -d -t -i -p 8081:80 -v /main_directory:/usr/local/apache2/htdocs --name docker_server httpd

fi

sudo cp -r -v -f * /main_driectory/

Creating Job 2:

No alt text provided for this image
No alt text provided for this image

Writing shell code to be run in RHEL 8:

if sudo docker ps | grep test_server

then

echo " Server is already running"

else 

sudo docker run -d -t -i -p 8081:80 -v /test_directory:/usr/local/apache2/htdocs --name docker2_server httpd

fi

sudo cp -r -v -f * /test_directory/

Creating Job 3:

No alt text provided for this image
No alt text provided for this image

Master branch is configured with Job1 which automatically deploy the data.

Dev1 Branch is configured with Job2 which automatically deploy docker container.

Job3 is made for testing . If testing is successful then jenkins will merge the dev1 branch to master branch .And alos it will trigger the job1.

To view or add a comment, sign in

More articles by Aastha Saxena

  • Jenkins and Groovy on Kubernetes

    What is Groovy? It is language in which we can write the code and steps to run JOBs of Jenkins. This language is very…

    2 Comments
  • Dynamic Cluster -Jenkins, Docker and Kubernetes

    In this article, we are going to explain how to make a dynamic Jenkins cluster with Kubernetes. Cluster: The group of…

    4 Comments
  • How to write a great resume?

    In this article I will share you my experience in how to write a resume. First of all , what we should write in resume?…

    6 Comments
  • Automation webserver using Kubernetes

    1. Create container image that’s has Jenkins installed using dockerfile Or You can use the Jenkins Server on RHEL 8/7 2.

    4 Comments
  • Ip-blocking using MLSecOps

    In this article I'm going to explain how we can block a particular IP, using Rhel8, Python script, Jenkins. Our Problem…

    16 Comments
  • AWS Deep Composer

    In this article, I will go through, how we can compose our music using AWS DEEP COMPOSER. Firstly, let us learn what is…

  • MLOps Journey

    Congratulations to my fellow MLOps students in the completion of MLOps Training given by Vimal Daga Sir. Let me…

    4 Comments
  • Face Recognition using Vgg-16

    In this article, I'm going to explain how we can make our own Face recognition and detection system using VGG-16 and…

    8 Comments
  • Machine Learning Integration with DevOps

    Task Overview:1. Create container image that’s has Python3 and Keras or numpy installed using dockerfile 2.

    2 Comments
  • Automation of webserver using Docker ,Jenkins, Git and Github

    Task Aim: 1. Create container image that’s has Jenkins installed using dockerfile 2.

    4 Comments

Others also viewed

Explore content categories