Import a snapshot from Git¶
Record a Git tree as an AWC snapshot. The manifest stores the source kind as
git and records the imported directory path as the locator.
AWC does not clone for you
--source-type git only sets the source kind in the manifest. AWC does not
clone, fetch, or parse a Git URL today. The import code path is the same as
a directory import. You MUST materialize the tree yourself.
The CLI does not populate source.immutable_revision. It is always null.
Record the revision in a label instead.
Before you start¶
- Set
AWC_TENANTandAWC_PROJECT, or pass--tenantand--project. Snapshot create requires both (spec §13.3). - Configure an object store. Export
AWC_CAS_URL, or pass--object-store-endpoint. The value must start withmemory://ors3://.
Procedure¶
- Materialize the Git tree to a local directory.
Note the checked-out revision. You pass it as a label in the next step.
- Import the directory and record Git provenance.
awcctl snapshot create \
--from-dir backend \
--source-type git \
--name backend-8e3a2f \
--label repository=acme/backend \
--label revision=8e3a2f1
--source-type git sets the manifest source kind to git. The default
normalization is source-normalized (spec §9.8). It zeroes owner, group,
and mtime, and keeps file type plus the executable bit. Pass
--normalization environment-preserving to keep captured modes and mtimes.
The command prints the snapshot id and a state of VALIDATING.
- Poll the snapshot until it reaches
READY.
A worker validates object closure, then advances the state
VALIDATING -> READY (spec §13.5, §12.1). The snapshot is mountable only
at READY.
- Confirm the Git source kind.
Read the source line. It shows git. The inspect record exposes the
source kind only. The locator and immutable_revision are held in the
manifest, which awcctl does not print.