Interview Questions For Jenkins
1. What is Jenkins?
Jenkins is an automated continuous integration open source tool which is written in programming language.
2. What is Continuous Integration?
Continuous Integration (CI) is the practice of development where developers integrate code into a shared repository frequently, preferably several times a day. Each integration can then be verified by an automated build and automated tests.
3. Name any two SCM supported by Jenkins?
- Git.
- Subversion
4. What are the drawbacks of jenkins?
- Not easy to maintain because it runs on a server and requires some skills as server administrator to monitor its activity.
- Jenkins does not allow one developer to see the commits done by other team member or we can say done by other developer which can cause lot of trouble with the release manager.
5. How can we create one click deployment for the whole infrastructure?
By creating CI/CD pipeline we can create one click deployment.
6. How will you build a job using poll scm in jenkins?
- Go to the configure page of a project.
- Go to the “Build Triggers” section.
- Check “Poll SCM”.
- Enter the schedule that you want to be in cron-style.
- The help that placed right side of input area might be useful.
- Example for poll at every 15 minutes is here as below:
- Save and Run the job
When any change is detected at polling, we can see that message in the log of Jenkins.
6. How will you build a job using Git Webhook?
- Open your github repository and navigate to the “Settings” tab.
- Select the “Webhooks” option on the left menu.
- Click “Add Webhook”
- For “Payload URL”:
- Use the address for the Jenkins server instance e.g. http://myjenkins.com
- Add /github-webhook/ to the end of it.
- Make sure to include the last /!.
- Example: http://myjenkins.com/github-webhook/.
- Select “application/json” as the encoding type.
- Leave “Secret” blank (unless a secret has been created and configured in the Jenkins “Configure System -> GitHub plugin” section).
- Select “Let me select individual events”.
- Enable PUSH event.
- Make sure “Active” is checked.
- Click “Add Webhook”.
Jenkins keep receiving notification for push event for respective repository, and corresponding build gets automatically triggered.
7. What is the default port for jenkins?
The default port for jenkins is 8080.
8. Where is the workspace directory for jenkins?
The workspace directory for jenkins is /var/lib/jenkins/workspace.