Jenkins Jenkins CI/CD Integration 1 — Questions and Answers
Question 1: What is Continuous Integration (CI) in the context of Jenkins?
- Automatically deploying code to production on every commit
- Automatically building and testing code on every commit to catch integration issues early (Correct answer)
- Integrating Jenkins with third-party monitoring tools
- Running nightly batch jobs automatically
Correct answer: Automatically building and testing code on every commit to catch integration issues early
CI means automatically building and running tests on every commit so that integration problems are caught early in the development cycle.
Question 2: How does Jenkins typically detect new code changes from a Git repository to trigger a build?
- Jenkins polls the repository on a schedule or receives a webhook push notification from the Git server (Correct answer)
- Developers manually click 'Build Now' after each commit
- Jenkins reads the Git log every minute via SSH
- Jenkins monitors the file system for changes
Correct answer: Jenkins polls the repository on a schedule or receives a webhook push notification from the Git server
Jenkins can either poll the SCM on a schedule (checking for changes) or receive a webhook push from GitHub/GitLab when new commits are pushed.
Question 3: What is the purpose of the 'Build Triggers' section in a Jenkins job configuration?
- To configure which agents the job runs on
- To define what events or schedules should automatically start a build (Correct answer)
- To set email recipients for build notifications
- To specify which artifacts to archive
Correct answer: To define what events or schedules should automatically start a build
Build Triggers define the conditions under which Jenkins automatically starts a build, such as webhooks, SCM polling, upstream job completion, or a cron schedule.
Question 4: What Jenkins trigger type uses a cron-like expression to schedule builds at specific times?
- Poll SCM
- Build periodically (Correct answer)
- Timer Trigger
- Cron Trigger Plugin
Correct answer: Build periodically
The 'Build periodically' trigger uses a cron syntax to schedule builds at regular intervals regardless of code changes.
Question 5: What does 'Poll SCM' trigger do in Jenkins?
- Triggers a build every time any user polls the Jenkins API
- Checks the source repository on a defined schedule and triggers a build only if changes are detected (Correct answer)
- Listens for webhook events from the SCM
- Polls all connected agents for available capacity
Correct answer: Checks the source repository on a defined schedule and triggers a build only if changes are detected
Poll SCM causes Jenkins to check the configured repository on a schedule (using cron syntax) and triggers a build only when new commits are found.
Question 6: What is an upstream/downstream job relationship in Jenkins?
- Upstream jobs run after downstream jobs complete
- An upstream job triggers a downstream job upon completion, creating a build chain (Correct answer)
- Upstream jobs are on the controller; downstream jobs are on agents
- Downstream jobs provide artifacts to upstream jobs
Correct answer: An upstream job triggers a downstream job upon completion, creating a build chain
In Jenkins, an upstream job can trigger one or more downstream jobs upon success, creating a build pipeline chain between separate jobs.
What is Continuous Integration (CI) in the context of Jenkins?