Interview Prep/CI/CD/Pipeline Design and Architecture

How do you prevent two pipelines from deploying to the same environment at once?

IntermediateProductionPipeline Design and Architecture
Answer

Serialise per environment: GitHub concurrency: { group: deploy-prod, cancel-in-progress: false }, GitLab resource_group: production, Jenkins lock plus milestone. For Terraform, state locking (DynamoDB or S3 native locking) is a second line of defence. Also guard against out-of-order deploys: a slow older pipeline must not overwrite a newer release, so check that the commit being deployed is still the head of main or newer than what is running.

deploy:
  resource_group: production
  script: ./deploy.sh
All CI/CD questions Roadmap: CI/CD fundamentals

More on Pipeline Design and Architecture