Configuring Jenkins
Add Sudo access to Jenkins with NO Password
- Login and become root user and then execute the following commands
vi /etc/ssh/sshd_config
# password Authentication to Yes
service sshd restart
visudo
# add the below line
# jenkins ALL=(ALL:ALL) NOPASSWD:ALL
Using git with jenkins
- ensure git is installed
sudo apt-get install git -y
- Login as jenkins user and verify the git using
git --version
- Note: This applies to any softwares in use from jenkins
Jenkins Projects
- Two kinds of Popular Projects are available in Jenkins
- FreeStyle:
- Project to create schedules of any activities
- Heavily relies on UI Components of Jenkins.
- If UI Components are not found, they can be added using plugins
- Pipeline
- FreeStyle:
Create a free style project to clone the code from git (GitHub)
- The project we will be cloning is spring pet clinic from here
- Create a new Item and select the options as shown below
- To understand different sections of Jenkins Freestyle project, Refer below
- Now configure Source Code Management with Git url https://github.com/spring-projects/spring-petclinic.git
- In the build section => Execute Shell
pwd
ls
- Lets examine what has happened in Jenkins Home Directory
- Whenever a project is created , In the Jobs folder of Jenkins HOme directory, a new folder with project name gets created. In this folder config.xml is project configuration, builds folder is available for symlinks of successful and pastbuilds
- Click on Build Now as shown below
- When your project/job is executed a folder gets created in Jenkins Home Directory in workspace folder
Continuous Integration
- Purpose of CI is give feedback about the commit(s) from developer(s)
Continuous Delivery
- Purpose of CD is give feedback about the days work done by the dev team
- Importance is for System Test/Performance Testing