Maven / GitLab CI Basics Interview Questions
What are manual jobs in GitLab CI/CD and how do you configure them?
A manual job is a job that is added to the pipeline but does not run automatically - it requires someone to click a button in the GitLab UI (or API call) to trigger it. Manual jobs are commonly used for production deployments that need human approval.
# Method 1: using rules deploy-production: stage: deploy script: - ./deploy.sh production environment: production rules: - if: $CI_COMMIT_BRANCH == "main" when: manual # must be clicked to run allow_failure: false # blocks pipeline completion until clicked # Method 2: legacy "when" keyword deploy-prod-legacy: stage: deploy script: ./deploy.sh production when: manual only: - main # Blocking vs non-blocking manual jobs: # Non-blocking (default): pipeline is marked as passed without clicking # Blocking: pipeline stays in "blocked" status until job is triggered # To make it blocking (requires allow_failure: false): critical-approval: stage: approve script: echo "Approval recorded" when: manual allow_failure: false # blocks the pipeline # Protected manual jobs (only certain roles can trigger): # Set in project Settings > CI/CD > Protected environments
allow_failure with manual jobs: when when: manual is set without allow_failure: false, the job is non-blocking - the pipeline proceeds (and can pass) without the manual job being triggered. With allow_failure: false, the pipeline stays in a blocked state until someone triggers the manual job.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
