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 git clone #179

Closed kzadorozhny closed 4 months ago

kzadorozhny commented 4 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 fetch --force --filter=blob:none --no-tags origin +refs/heads/deploy/*:refs/remotes/origin/deploy/*