Search This Blog

Friday 19 April 2019

DevOps

GIT COMMANDS:
Its a source code management tool
Distributed version control system
GIT Install
yum install git -y
git --version
git config
git config –global user.name “[name]” 
 git config –global user.email “[email address]”
 git init [repository name]
git clone [url] 
git add [file] 
git commit -m “[ Type in the commit message]” 
git diff 
git diff [first branch] [second branch]
git reset [file]
git reset [commit]
git reset –hard [commit]
git revert [commit]
git status
git rm [file]
 git log
git log   --oneline
git log –follow[file]
git show [commit]
 git tag [commitID]
git branch -------->to see list of branches
git branch [branch name] -------->create branch
git branch -d [branch name]------>delete branch
git checkout [branch name]------>switch to that particular branch
git checkout -b [branch name]---->create new branch and switch to it
git merge [branch name]----->merging
git remote add [origin] [URL]
git push [origin] master
git push  [URL]
git pull [URL]
git stash save ----->save/store ---------> stores only modified files //for temporary storage
git stash pop-----> restore
git stash list ------> list of files in stash
git stash drop ------> discard/delete

.GITIGNORE ---------> it will ignore the file that you mentioned inside that gitignore file
                                           create file ,add, and commit/push file to central repository.
================================================================================================================================================
DOCKER:

Docker is containerization tool ,which we can pull images from docker registry and convert them to containers.
By using docker file we can build docker images.

Docker Installation:
docker --version
docker info
docker serach image
docker pull  [image]
docker push
docker images
docker ps
docker ps -a
docker rm [container]
docker rmi [image]
docker start [container ]
docker attach [container ]
docker stop [container]
docker kill
docker rm -f $(docker ps -aq) ---->delete running and stopped containers
docker status
docker buid -t image .
docker run -it imagename //bin/bash
docker run -it --name   [containername]   [imagename] //bin/bash
docker commit [container]
docker tag   <image id>    newname
docker run -it  --name  [new container]  --privileged =true    --volume -from   [old container]                                                                                                                                                                    image//bin/bash
docker inscept containername
docker run -it containername -p 8080:8080   imagename//bin/bash
docker exec -it  containername//bin/bash
docker system prune----> will remove everything
================================================================================================================================================
JENKINS:

yum update -y
yum install java-1.8*
java --version
set path
EXPORT PATH
jenkins.io
wget URL .tar.gz
unzip .....
type 'ls'  you will see file
yum install jenkins -y
service jenkins start
chkconfig jenkins on
cd        /usr/lib/jenkins------------> jenkins.war
cd      /var/lib/jenkins -------------> jenkins home
open port number ->>>>8080
goto Browser : 
IPaddress:8080
jenkins page will start install all the required plugins.
================================================================================================================================================
APACHE TOMCAT:

Install tomcat
wget URL .tar.gz
extract tar.gz file
set path  mv    tomcatfile   /opt
cd  /opt/tomcat.../config---------------->server.xml [change the port]
             ---------------- >user.tomcat.xml[add user and password]
cd  /opt/tomcat../bin --------> ./startup.sh
                                 --------> ./shutdown.sh
cd  /opt/tomcat../webapp/meta-inf/manager/context.xml------------>comment <!--     -->
                                                     /host-manager/context.xml-------->comment<!--    -->
goto Browser   localhost:portnumber.
you will see tomcat page   login with user and password.


No comments:

Post a Comment