Continuous integration, CI, is the practice in software engineering of merging all developer working copies to shared mainline several times a day.
If you're familiar with Git, you will see that continuous integration is just integrating your own code together with the rest of the projects.
This can be in the master branch, develop branch, or even in your own branch.
Continuous delivery, on the other side, abbreviated as CD, is a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time.
Jenkins can really help you to release software in short cycles and then ensure it's reliability because we are going to test and build the software over and over again.
In practice, CI and CD means that we are going to verify and publish work by triggering automated builds and tests. And Jenkins is a tool that we can use for that.
We are going to do these automated builds and tests for every commit, or at least once a day.
All developers should push their changes to version control, which should then be built and tested, which can be done by Jenkins.
Jenkins doesn't merge code, nor it resolves code conflicts.
Jenkins provides a feedback loop back to the developer to fix the build errors.
It is a lot quicker to have a developer fix the error immediately rather than wait with it because it's then when the code is still fresh in memory.
Jenkins can publish every build of your software. Every time someone commits a change, Jenkins can build and publish this piece of software.
This build already has gone through automated testing, you can configure this in Jenkins. Then, Jenkins will test whether the code is good, whether the features the developer implemented actually work and then when published and deployed to development, a QA or staging server, you can advance the software development life cycle, the SDLC, much quicker.
The quicker you can go through an iteration of the SDLC the better.
Call to WHvSetupPartition failed: ERROR_SUCCESS (Last=0xc000000d/87) (VERR_NEM_VM_CREATE_FAILED).
1. Go to Type here to search 2. Type into the search textbox Turn Windows features on or off 3. Make sure both Hyper-V and Windows Sandbox are unchecked/disabled 4. If the system requires a restart, perform the restart. 5. Restart a second time to ensure all Hyper-V features are disabled
We will be using putty hereafter, so let get the Ip address from the VM. We are using putty rather than VM because managing things from Putty is actually pretty simple and it's even easier.
If below steps become outdated then you refer to official docs : https://docs.docker.com/engine/install/centos/#install-using-the-repository
Step:1) Enable Docker CE Repository
As we said above, docker packages are not available any more on CentOS 8 or RHEL 8 package repositories, so run following
dnf command to enable the Docker CE package repository.
[[email protected] ~]# dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
Step:2) Install Docker CE using
Once the docker ce repo has been configured successfully then run following command to verify which version of docker is available for installation
[[email protected] ~]# dnf list docker-ce
Available Packages docker-ce.x86_64 3:19.03.5-3.el7 docker-ce-stable
Now, use beneath
dnf command to install the latest version of docker,
[[email protected] ~]# dnf install docker-ce --nobest -y
After the installation of docker, start and enable its service using the following
[[email protected] ~]# systemctl start docker [[email protected] ~]# systemctl enable docker
Run the following command to verify installed docker version
[[email protected] ~]# docker --version Docker version 18.06.3-ce, build d7080c1 [[email protected] ~]#
Step:3) Verify and test Docker CE Engine
To verify whether docker ce engine has been set up correctly or not, try to spin up a "hello-world" container using below docker command,
[[email protected] ~]# docker run hello-world
Output of above command
We will need docker compose, we an install the docker compse using
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
You have to provide executable access to docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Let's install the Jenkins image on docker, so let's pull the Jenkins image from docker repo. You can find the Jenkins image on https://hub.docker.com/r/jenkins/jenkins/
# jenkins image pull command docker pull jenkins/jenkins
Once the Jenkins image is installed you can see where it is located using the following command.
[[email protected] ~]# docker info | grep -i root # output Docker Root Dir: /var/lib/docker
We have installed jenkins but we have not started the jenkins service. To start jenkins we need to configure the docker-compse file. docker compose file helps to store the data and to specify ports and network for the jenkins service.
When a docker image is destroyed all the data in also will be destoryed, but we need to store the data before destrying the docker image. So using docker-compose file we can specify where we want to save the data.
Let's create a folder to store all the Jenkins related stuff and open it.
mkdirto create a folder
cdto open the folder
pwdto see the present working directory
[[email protected] ~]# mkdir jenkins-data [[email protected] ~]# ls anaconda-ks.cfg jenkins-data [[email protected] ~]# cd jenkins-data/ [[email protected] jenkins-data]# pwd /root/jenkins-data [[email protected] jenkins-data]#
Now e need to store the data from the jenkins image, to store it we have to create another folder insie the
jenkins-data . Also we will be using this folder inside our docker-compse file.
[[email protected] jenkins-data]# mkdir jenkins_home [[email protected] jenkins-data]#
jenkins-data folder and put the below content. Use spaces and not tabs
version: '3.7' services: jenkins: container_name: jenkins image: jenkins/jenkins ports: - "8080:8080" volumes: - $PWD/jenkins_home:/var/jenkins_home networks: - net networks: net:
if you list the directory; you should see below items
[[email protected] jenkins-data]# ls docker-compose.yml jenkins_home
Once we create the docker-compose, we can create/start the Jenkins service.
Before we start we need to give permission to the user to write data to the jenkins_home folder
[[email protected] jenkins-data]# sudo chown 1000:1000 jenkins_home -R
Start the jenkins:
[[email protected] jenkins-data]# docker-compose up -d Creating network "jenkins-data_net" with the default driver Creating jenkins ... done
Check whether docker service up or not using
docker ps command
Now let's get the authentication key; we need authentication for the UI, to get authentication keys; let's open the logs of Jenkins container.
Syntax #docker logs -f container_name # f - full and continue to show logs docker logs -f jenkins
To terminate the log continuation press CTRL+C
Get your VM IP address by
ip a and use the port as 8080 as defined in docker-compose.yml file.
Use the copied key to unlock the Jenkins and Install Suggested Plugins
Save and Continue then Finish.
Tada, You are at END and Installation is successful.
docker-compse up -d
docker-compose up -d
docker kill jenkins
Remove the downloaded docker images
#docker rmi ImageName docker rmi jenkins/jenkins
rm -rf folderName
I am Pavankumar, Having 8.5 years of experience currently working in Video/Live Analytics project.