⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ 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) →
← Back to All CI/CD & GitOps Interview Questions Scenario 103 of 187 in CI/CD & GitOps
Senior DevOps / SRE [L2] CI/CD 🔐 Supply Chain Security & Advanced CI/CD Production Scenario [L2]
🎯 Target Role / Context: CI/CD Scenario #94 (L2) · 🔐 Supply Chain Security & Advanced CI/CD

Q: Half of your engineering team works on Windows laptops and half on macOS. Your shell scripts in CI keep failing on Windows runners because of line ending issues (`\r\n` vs `\n`) and path separator differences. How do you make your CI pipelines platform-agnostic?

Root cause: Windows uses CRLF (\r\n) line endings; Linux/macOS use LF (\n). Shell scripts with \r characters fail silently or with cryptic errors on Linux runners.

#CI/CD #L2 #DevOps #Automation #Pipelines #Comparisons
🎙️ Candidate Opening & Architectural Context
""When developers encounter this build or release bottleneck, my first goal is unblocking velocity safely. The interviewer is testing: Cross-platform CI, .gitattributes, containerised CI builds.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third.""
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? KodeKloud's Enterprise GitOps with ArgoCD & Kubernetes Rollouts covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

Direct Answer: "When developers encounter this build or release bottleneck, my first goal is unblocking velocity safely. The interviewer is testing: Cross-platform CI, .gitattributes, containerised CI builds.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third."

1️⃣

Initial Diagnostics & Root Cause Analysis

Root cause: Windows uses CRLF (\r\n) line endings; Linux/macOS use LF (\n). Shell scripts with \r characters fail silently or with cryptic errors on Linux runners.

  • .gitattributes normalisation: Add *.sh text eol=lf and *.bat text eol=crlf to force correct line endings in the repo regardless of developer OS.
  • Containerise the CI build: Run all CI jobs inside a Linux Docker container (runs-on: ubuntu-latest with a Docker executor). Windows developers run the same container locally via Docker Desktop. The environment is identical everywhere.
  • Replace shell scripts with Python or a task runner (Makefile / Taskfile): Python handles path separators with pathlib.Path natively. Taskfile (go-task) has explicit cross-platform task definitions.
2️⃣

Remediation & Permanent Safeguards

Solutions (layered):

  • Use #!/usr/bin/env bash consistently and validate scripts with shellcheck in CI to catch portability issues.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: .gitattributes normalisation: Add *.sh text eol=lf and *.bat text eol=crlf to force correct line endings in the repo regardless of."
⚡ 60-Second Elevator Pitch Talking Points
  • .gitattributes normalisation: Add *.sh text eol=lf and *.bat text eol=crlf to force correct line ...
  • Containerise the CI build: Run all CI jobs inside a Linux Docker container (runs-on: ubuntu-lates...
  • Replace shell scripts with Python or a task runner (Makefile / Taskfile): Python handles path sep...
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Promoting application releases to production without an automated, canary-validated rollback mechanism when configuring Half engineering team Pipelines that lack automated rollback mechanisms force engineering teams to scramble manual hotfixes during severe production regressions.
  2. Running concurrent deployment pipeline jobs without stage mutex locking on shared target environments when configuring Half engineering team Concurrent pipeline runs on the same environment race to apply state changes, causing out-of-order commits and unpredictable deployment state.
  3. Omitting dependency lockfiles (package-lock.json, go.sum, Cargo.lock) from continuous integration builds when configuring Half engineering team Omitting lockfiles allows upstream package updates to break builds unpredictably without any changes to application codebase.
  4. Failing to define dynamic cache invalidation keys for CI package managers and layer caches when configuring Half engineering team Stale build caches mask underlying dependency incompatibilities or pull outdated libraries, while un-cached runs slow feedback loops.
Advertisement
Want more CI/CD & GitOps scenarios?
Explore our complete collection of scenario-based CI/CD & GitOps interview runbooks.
Browse All CI/CD & GitOps Questions →