Production deployment shape
environment: production
concurrency:
group: production-deploy
cancel-in-progress: false- The environment provides a policy boundary.
- The concurrency group serializes production deployment work.
Protect deployments with environment-specific controls, deliberate promotion and concurrency rules that prevent overlapping releases.
GitHub environments can associate deployment targets with secrets, variables and protection rules. Production controls should be stronger than ordinary CI validation.
A manual promotion should approve the already-validated artifact. Rebuilding after approval creates a new unvalidated set of bytes.
A concurrency group can prevent overlapping workflow or job executions for the same deployment target. Depending on policy, a newer run can queue or cancel an older in-progress run.
environment: production
concurrency:
group: production-deploy
cancel-in-progress: falseGoal: Use a filesystem lock to model why only one production deployment should mutate a target at a time.
mkdir -p ~/gnu-cicd-labs/module08 && cd ~/gnu-cicd-labs/module08
cat > deploy.sh <<'EOF'
#!/usr/bin/env bash
set -euo pipefail
exec 9>deploy.lock
flock -n 9 || { echo 'deployment already in progress'; exit 20; }
printf 'deploying %s\n' "${1:-unknown}"
sleep 1
printf '%s\n' "${1:-unknown}" > deployed.txt
EOF
chmod +x deploy.sh./deploy.sh build-001grep -q 'build-001' deployed.txtprintf '%s\n' 'concurrency group: production-deploy' 'environment: production'Serialized production deployments prevent two independently valid changes from corrupting shared rollout state.
Open each answer only after you have tried to answer the question yourself.
The already-built and validated artifact, not a fresh rebuild.
To prevent overlapping runs from racing while mutating the same environment.
A deployment policy boundary with environment-specific variables/secrets and protection rules where configured.
Progress is saved in this browser immediately. When you sign in to My Learning, it can also sync across devices.
Attempt the core lab and knowledge checks before marking the module complete.