CICD-493 · Deployment freeze windows
Encyclopedia · Pipeline governance and operational management · All snippets
Previous · CICD-492 · Next · CICD-494
1. Where it fits
- Placement CD calendar gate.
- Prerequisites trusted policy checkout and normalized deployment events with scoped access.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
now=$(date -u +%FT%TZ)
jq -e --arg now "$now" 'all(.windows[]; $now < .start or $now >= .end)' policy/freeze.json3. How it works
The calendar gate treats a freeze as a UTC interval with an inclusive start and exclusive end. The deploy job should stop if now falls in any active window.
A release freeze blocks the deployment before a write.
flowchart TD
N1["Current UTC timestamp"]
N2{"Inside freeze window"}
N1 --> N2
N3["Approved freeze calendar"]
N3 --> N2
N4["Fail deployment gate"]
N2 -->|Yes| N4
N5["Proceed to next check"]
N2 -->|No| N5
classDef trigger fill:#EFF6FF,stroke:#0540F2,color:#0A0A0A
classDef build fill:#CCFBF1,stroke:#0D9488,color:#0A0A0A
classDef test fill:#EEF2FF,stroke:#4F46E5,color:#0A0A0A
classDef gate fill:#FEF3C7,stroke:#D97706,color:#0A0A0A
classDef security fill:#EDE9FE,stroke:#7C3AED,color:#0A0A0A
classDef deploy fill:#D1FAE5,stroke:#059669,color:#0A0A0A
classDef fail fill:#FEE2E2,stroke:#DC2626,color:#0A0A0A
class N1 trigger
class N2 gate
class N3 security
class N4 fail
class N5 deploy
4. Verify the result
Use canonical UTC intervals and a protected calendar source. Verify both boundary and overlapping cases.
Validation syntax-validated (Bash parse). Status definitions.