โšก ~/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 ๐Ÿ” Supply Chain Security & Advanced CI/CD Production Scenario [L2]

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 crypti...

#CI/CD #๐Ÿ” Supply Chain Security & Advanced CI/CD #L2 #DevOps #Automation #Pipelines
๐ŸŽ™๏ธ 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

๐Ÿ› ๏ธ Production Runbook & Step-by-Step Resolution

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...
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