This repository contains code for my portfolio web pplication.
This projects builds a Jenkins CI pipeline. Every time I commit changes to this repository. Jenkins will build the docker image of my web application, push it to the Docker hub to a specific repository, and update the version of the web application in the GitHub.
Read this blog for a better understanding of this project.
- use Ubuntu version 18.04 lts for the host server machine.
- port
22
: ssh - add only your device's ip address - port
8080
: jenkins - this is where your jenkins server is running
ssh root@<ipAddressServer>
echo 'PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "' >> .bashrc && source .bashrc
- Install docker:
apt update -y && apt install docker.io -y
docker run -d -p 8080:8080 -p 5000:5000 -v jenkins_home:/var/jenkins_home -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock --name jenkins jenkins/jenkins:lts-jdk11
docker exec -it -u 0 jenkins bash
chmod 666 /var/run/docker.sock
exit
- This file can be accessed by root user as well
docker exec -it jenkins bash
cat /var/lib/jenkins/secrets/initialAdminPassword
- Create below creadentials IDs:
- github (git repository)
- dockerhub (artifact repository)
- Ad webhook in github
<ipAddressOfHostServer>:<portNoOfJenkins>/github-webhook/
- E.g.->
143.110.184.204:8080/github-webhook/
- E.g.->
- Add GitHub SCM trigger
- Add 'jenkins' user to the list of Polling ignores commits from certain users!