1. What to use Jobs, Builds & Triggers for?
- Jobs is individual tasks or workflows that need to be executed. These tasks could include building, testing, deploying, or any other automation task.
- Builds is the execution of a job. When a job is triggered Jenkins initiates a build process to perform the defined tasks within that job.
- Triggers in Jenkins determine how and when a build should start:
+ Build after other projects are built: This trigger allows a job to be executed after one or more specified projects have completed their builds. It's useful for setting up a sequence of jobs where the output of one job is required before starting another. For example, you might have a deployment job that should only run after a successful build job
+ Build periodically:With this trigger, you can schedule jobs to run at regular intervals, using a cron-like syntax to specify the schedule. It's ideal for workflows that need to occur regularly regardless of code changes, such as nightly builds or weekly integration tests.
GitHub hook trigger for GITScm polling:
+ This trigger is designed for projects hosted on GitHub. It utilizes webhooks to start builds automatically when a change is pushed to the repository. Instead of polling GitHub for changes, which can consume resources and delay builds, the webhook immediately notifies Jenkins of any SCM changes, triggering the build process.
+ Poll SCM: "Poll SCM" periodically checks the source code management (SCM) system for changes and triggers a build if any are found. You define the polling frequency using cron syntax. While effective, it's less efficient than webhook-based triggers (like the GitHub hook trigger) because it periodically checks for changes rather than reacting to them instantly.
+ Quiet period: The quiet period is not a trigger by itself but a configuration option that can be used with other triggers. When a build is triggered, Jenkins waits for the specified quiet period (in seconds) before starting the build. This delay can be useful to batch SCM changes or to reduce the load on the build system by preventing too many builds from starting in quick succession.
+ Trigger builds remotely (e.g., from scripts):This option allows builds to be triggered remotely via HTTP GET or POST requests. It's particularly useful for integrating Jenkins with other tools or scripts that aren't directly supported by Jenkins plugins. You can secure this trigger with an authentication token to ensure that only authorized sources can initiate the build.
2. How to use Jobs, Builds & Triggers?
- Jobs: Create Jobs, Configure Jobs, Run Jobs.
- Builds: View Builds, Monitor Builds, Analyze Builds.
- Triggers: Configure Triggers, Define Trigger Conditions, Monitor Trigger Events.
----------------------------
Detailed instructions
- Triggers:
+ Add triggers for job: select job/ Build Triggers: Poll SCM/ Schedule: */5**** (execute a task every 5 minutes)/ Save
- Environment Variables in command of Build (JenkinFile)
+ Configure job/ Pipeline Syntax/ Global Variable Reference
Reference
Thank you
No comments:
Post a Comment