adobe / rules_gitops

This repository contains rules for continuous, GitOps driven Kubernetes deployments.
Apache License 2.0
172 stars 43 forks source link

use lightweight checkout #180

Closed kzadorozhny closed 5 months ago

kzadorozhny commented 5 months ago

Optimize git commands used by the create_gitops_prs tool to support referencing shallow repository clones via --mirror parameter.

Replace gitops repository clone command:

git clone --no-checkout --reference <mirrorDir>  <repo> <gitopsWorkDir>

with the sequence of commands:

git clone --no-checkout  --single-branch --branch <primaryBranch> --filter=blob:none  --no-tags --reference <mirrorDir>  <repo> <gitopsWorkDir>
git remote set-branches --add origin "deploy/*"
git fetch --force --filter=blob:none --no-tags origin