A development team wants to automate their workflow. Their goal is to have every git push to the main branch automatically trigger a process that builds the application, runs a full suite of integration tests, and then deploys the application to a staging server for review. Which of the following approaches BEST satisfies all requirements of this scenario?
Automating the workflow using a set of independent shell scripts
Using a cron job to periodically pull and deploy changes
Configuring a post-receive Git hook to run deployment scripts
The correct answer is 'Setting up a Jenkins pipeline'. A full CI/CD (Continuous Integration/Continuous Deployment) pipeline is required to meet all the scenario's requirements: building, testing, and deploying automatically after a code push. Jenkins is a widely-used automation server specifically designed to orchestrate these multi-stage pipelines.
The other options are less suitable:
Configuring a post-receive Git hook can trigger a script, but it lacks the robust workflow management, logging, and integration features of a dedicated CI/CD tool needed for a multi-stage process.
A cron job runs on a schedule (e.g., every hour), not in response to a git push, so it would not provide immediate feedback after a commit.
While individual shell scripts would be used to perform tasks within the pipeline, they do not provide the overarching orchestration framework to manage the entire workflow from trigger to deployment.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a Jenkins pipeline and how does it work?
Open an interactive chat with Bash
How does a Jenkins pipeline differ from a Git hook?
Open an interactive chat with Bash
What are the advantages of using Jenkins pipelines over cron jobs or shell scripts?