tiktok-sparo/apps/website/docs/pages/ci_commands/overview.md
2024-03-01 00:19:27 -08:00

1.2 KiB

title
Overview

Everyday development involves a variety of Git operations such as switching between branches, fetching incremental changes from the server, and browsing history. By contrast, when a continuous integration (CI) pipeline checks out a Git branch, it is typically a much simpler operation, and the folder or entire virtual machine image may be discarded as soon as the job completes. Therefore, different approaches for optimizing Git require required for these two use cases.

Sparo provides a separate command line sparo-ci that is specifically optimized for CI pipelines. The current implementation takes this approach:

  • It uses treeless clone instead of blobless clone, under the assumption that Git history will be rarely needed.

    Shallow clone is a common alternative, however it has trouble supporting operations such as incremental build or publishing that require comparison with a base branch.

  • Spare checkout is configured, and the skeleton folders are included.

Currently two subcommands are supported for CI:

  • sparo-ci checkout
  • sparo-ci clone