Interview Prep/CI/CD/Jenkins Pipelines and Agents

You need a nightly job that runs a full regression suite at 2 AM and a separate hourly smoke run. How do you schedule them?

BeginnerScenarioJenkins Pipelines and Agents
Answer

Situation read → Time-based triggers inside the pipeline.

What I'd do →

triggers { cron('H 2 * * *') }

The H hashes the minute so jobs do not all start at once. For the hourly smoke run use cron('H * * * *') in a separate job or parameterize one job with a SUITE choice parameter.

Why → H spreads load, and separate jobs keep history and alerting clean.

Interview tip → Mention that cron triggers on multibranch jobs only fire on branches that have run the Jenkinsfile once.

All CI/CD questions

More on Jenkins Pipelines and Agents