yum install git -y
If not Working
wget https://github.com/git/git/archive/v2.10.1.tar.gz -O git.tar.gz
tar -zxf git.tar.gz
cd git-2.10.1/
make configure
./configure --prefix=/usr/local
make install
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
Install jenkins
yum install jenkins -y
Install openjdk by jenkins
yum install java-11-openjdk -y
Go to yum.repos.d
cd /etc/yum.repos.d
make new file 'dokcer.repo'
vim docker.repo
gedit docker.repo
type it in docker.repo
[docker]
baseurl = https://download.docker.com/linux/centos/7/x86_64/stable/
gpgcheck=0
install docker
yum install docker-ce -y --nobest
$ git config --global user.name "myname"
$ git config --global user.email myemail@example.com
Note : It will ask you password itself!!! for security reasons!
$ # create folder
$ mkdir jenkins_web_jenkins
$ # change dir
$ cd jenkins_web_jenkins
$ # make new html file, write and save it
$ notepad index.html
$ # Create git project
$ git init
$ # add all files in staging area
$ git add .
$ # commit messages
$ git commit . -m 'first commit'
$ # add remote where to push to github url
$ git remote add origin https://github.com/amantiwari1/jenkins_web_server..git
$ # upload all files to github website using name which add earlier url
$ git push -u origin master
start service in rhel 8
$ systemctl start jenkins
find ip address using command
$ ifconfig
it is my ip is 192.168.42.164
go to jenkins website
Note: Port iis 8080 otherwise Not working!!
it will ask you password
$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword
435jwhwj4h5jhw3j5hesh45jhw34ehre
go to Manage Jenkins > Manage Users > setting logo > password
change password
go to DeshBoard
go to Manage Jenkins > Manage Plugins > Available
search 'github'
tap tick it
tap 'Download now and install after restart'
go to DeshBoard
tap Create New jobs
type 'web1'
tap Freestyle project and ok
go to Source Code Management and tick git
copy and paste from github url : https://github.com/amantiwari1/jenkins_web_server..git
go to build and add execute shell
save it
Disable Linux Security
$ setenforce 0
Docker start in service
$ systemctl start docker
docker download new image 'httpd' for web server
$ docker pull httpd
launch httpd with port !!
$ cd web1
$ docker run -dit --name web1 -p 8081:80 -v "$PWD":/usr/local/apache2/htdocs/ httpd
go to http://192.168.42.164:8081
check if it is working!!
go to http://192.168.42.164:8080
go to web1 in job
build now if you changed in some file
for Jenkins with DockerFile