You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): add --docker-export-to-cache flag with proper precedence
Add CLI flag to control Docker export mode globally with proper
precedence handling following standard Leeway patterns.
Precedence order:
1. CLI flag (if explicitly set) - highest priority
2. Environment variable LEEWAY_DOCKER_EXPORT_TO_CACHE
3. Package configuration (default)
Changes:
- Add --docker-export-to-cache boolean flag
- Check flag.Changed() to detect explicit CLI usage
- Fall back to LEEWAY_DOCKER_EXPORT_TO_CACHE env var
- Pass both value and explicitlySet to BuildOption
- Update help text with examples and env var documentation
This enables:
- Per-build override: leeway build --docker-export-to-cache
- CI-level override: LEEWAY_DOCKER_EXPORT_TO_CACHE=true
- Bidirectional override (can enable OR disable)
Co-authored-by: Ona <[email protected]>
cmd.Flags().String("report-segment", os.Getenv("LEEWAY_SEGMENT_KEY"), "Report build events to segment using the segment key (defaults to $LEEWAY_SEGMENT_KEY)")
191
208
cmd.Flags().Bool("report-github", os.Getenv("GITHUB_OUTPUT") !="", "Report package build success/failure to GitHub Actions using the GITHUB_OUTPUT environment variable")
192
209
cmd.Flags().Bool("fixed-build-dir", true, "Use a fixed build directory for each package, instead of based on the package version, to better utilize caches based on absolute paths (defaults to true)")
210
+
cmd.Flags().Bool("docker-export-to-cache", false, "Export Docker images to cache instead of pushing directly (enables SLSA L3 compliance)")
0 commit comments