Anda di halaman 1dari 11

DevOps

DevOps is a Software Development approach which involves


Continuous Development, Continuous Testing, Continuous
Integration, Continuous Deployment and Continuous Monitoring
of the software throughout its development life cycle.

Software Development stages depicted in the diagram below.

Continuous Development:
This is the stage in the DevOps life cycle where the Software is
developed continuously. This stage involves the Coding and
Building phases and makes use of tools such as Git and SVN for
maintaining the different versions of the code, and tools like
Ant, Maven, Gradle for building / packaging the code into an
executable file that can be forwarded to the QAs for testing.

Continuous Testing:
It is the stage where the developed software is continuously
tested for bugs. For Continuous testing testing automation tools
like Selenium, JUnit etc are used

Continuous Integration:
This is the stage where the code supporting new functionality is
integrated with the existing code. Jenkins is a very popular tool
used for Continuous Integration.
Continuous Deployment:
It is the stage where the code is deployed to the production
environment. Since the new code is deployed on a continuous
basis, automation tools play an important role for executing
tasks quickly and frequently. Puppet, Chef, SaltStack and
Ansible are some popular tools that are used in this stage.

Continuous Monitoring:
This is a very crucial stage in the DevOps life cycle which is
aimed at improving the quality of the software by monitoring its
performance. This practice involves the participation of the
Operations team who will monitor the user activity for bugs /
any improper behavior of the system

Plan + Code = Git, Subversion, Jira

Build Maven, gradle,

Test Selinium, Junit

Deploy + Operate Puppet, Chef, Saltstack


Monitor Nagios, Sensu, New Relic

GIT
Git is a free, open source distributed version control system tool
designed to handle everything from small to very large projects
with speed and efficiency.

Version Control is the management of changes to documents,


computer programs, large websites and other collection of
information.
There are two types of VCS:

Centralized Version Control System (CVCS)

Distributed Version Control System (DVCS)

Centralized VCS
Centralized version control system (CVCS)

Distributed VCS
Git is a Distributed Version Control tool that supports
distributed non-linear workflows by providing data assurance
for developing quality software.

What is Git Role Of Git In DevOps?


The motive of Git is to manage a project or a set of files as they
change over time. Git stores this information in a data structure
called a Git repository. The repository is the core of Git.

To be very clear, a Git repository is the directory where all of


your project files and the related metadata resides

Some of the basic operations in Git are:

1. Initialize

2. Add

3. Commit

4. Pull

5. Push

Some advanced Git operations are:

1. Branching

2. Merging

3. Rebasing
GIT installation in windows

1. Download git from https://git-scm.com


2. Download the exe and run it.
3. Install the git-bash, git-gui options when the window pops
up
4. Choose the git from gitbash option
5. Configure the extra options.
6. Choose your terminal
7. Finish
8. The git bash terminal window will start up
9. Configure your name and email by using the following
commands

git config global user.name <your name>

git config global user.email <your email>

git config list = will list all configuration details

GIT installation on Ubuntu


On a gui version of Ubuntu, search for terminal and then type
the below commands.

If you are working on a windows pc with your Ubuntu on a


virtual env, then download putty.

On the Ubuntu terminal window type ifconfig not the IP


address

Use Putty and the IP gathered to log into the Ubuntu server
from your pc. The advantages of using putty is flexibility and
also copy/paste options.

1. sudo apt-get update

2. sudo apt-get install ca-certificates curl openssh-server


postfix

3. postfix may already be installed but in case you get the


prompt, choose internet options and input your servers
domain name and ip address

4. To install Git lab

Move into the /tmp directory and then download the installation
script:

cd /tmp

curl LO
https://packages.gitlab.com/install/repositories/gitlab/gitla
b-ce/script.deb.sh

sudo bash /tmp/script.deb.sh

sudo apt-get install gitlab-ce this will install the


components. Next step is to reconfigure

sudo gitlab-ctl reconfigure

To check the firewalls the commands are


sudo ufw status

To allow HTTP access in, open ssh port should be open

sudo ufw allow http

sudo ufw allow OpenSSH

Now to access the git lab, on your PC, open browser and type in
the IP address of the Ubuntu server where you have configured
the git lab.

http://gitlab_domain_or_IP

GIT Install on Centos

1. sudo yum groupinstall Development Tools


2. click Y when prompted to install

3. sudo yum install gettext-devel openssl-devel perl-


CPAN perl-devel zlib-devel
enter password and click Y to proceed

4. use the wget command to pick the version you are


looking to install

https://www.kernel.org/pub/software/scm/git/?
utm_source=blog&utm_medium=content-
link&utm_campaign=install-git

wget https://github.com/git/git/archive/v2.7.2.tar.
gz -O git.tar.gz

tar -zxf git.tar.gz


cd git

make configure

make configure./configure prefix=/usr/local


sudo make install

git version
git config global user.name Your Name

git config global user.email you@example.com

5. Generate SSH key now

To add ssh key

ssh-add ~/.ssh/id_rsa

Jenkins Installation

Start the server and get the IP. Use the putty to reach it.

1. After logging in, change the hostname

Vim /etc/hostname

Esc+I = allows you to insert text in the window

After you change the hostname

Esc + :wq! = allows you to save the changes and come


back to the root prompt.

Reboot the server = reboot or init 0

2. Apt-get update y ( to update the Ubuntu server with any


patches or packages)

3. To add the debian repository, the command is

Wget q O https://pkg.jenkins.io/debian/jenkins.io.key |
sudo apt-key add -

4. Then add the following in the


/etc/apt/sources.list.d/Jenkins.list. To do this.

From the prompt cat /etc/apt/sources.list.d/Jenkins.list


( this will open the file sources.list for you to enter stuff ).
The same process needs to be followed

Esc + I ( Insert or to allow type )


Add this entry : deb https://pkg.jenkins.io/debian binary/

Esc + :wq! = save and exit

5. Update the local packages by running the below


commands

Sudo apt-get update

Sudo apt-get install Jenkins

6. Service Jenkins status to check the status of jenkin


service

7. Type if config, copy the IP address

8. <192.168..> hostname.local hostname

ex- 192.168..1.1 jenkins.local Jenkins

add this line in the hosts file - /etc/hosts.

9. Restart Jenkins service Jenkins restart

10. You can also add this entry to the host file in your
windows pc c:\windows\system32\drivers\etc\hosts

11. Open the browser and give the host name or ip


address:8080 hostname:8080

12. Your Jenkins page should open up. Go to the location


specified on the page and copy the password and paste it
in the Jenkins page.

13. Install the suggested plugins recommended

14. Create the admin user

15. To administer Jenkins you need to click manage


Jenkins and define the security levels required.