⚡ ~/naveed Interview Prep
⚡ Portfolio Home ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 998+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
Senior DevOps / SRE [L2] CI/CD GitLab CI Production Scenario [L2]

Q: Your GitLab CI pipeline has a job that needs to run only when a specific file is changed. How do you configure this?

Use rules with changes:

#CI/CD #GitLab CI #L2 #DevOps #Automation #Pipelines
🎙️ Candidate Opening & Architectural Context
""During a high-stakes release, we hit a similar deployment challenge and resolved it with automated safeguards. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix.""
Advertisement

🛠️ Production Runbook & Step-by-Step Resolution

1️⃣

Production Solution & Architecture

Use rules with changes: This job only runs when files under frontend/ or package.json change in the commit. For more complex conditions:

deploy-frontend:
  rules:
    - changes:
        - frontend/**
        - package.json
  script:
    - npm run build
    - npm run deploy
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Use rules with changes:."
⚡ 60-Second Elevator Pitch Talking Points
  • Immediate Triage: Use rules with changes:
  • Run targeted verification commands before modifying configuration.
  • Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement
Want more CI/CD scenarios?
Explore our complete collection of scenario-based CI/CD interview runbooks.
Browse All CI/CD Questions →

📚 Related Production Scenarios in CI/CD