sow publish
sow publish copies the current Built Generation to a target in the targets: section of sow.yml. The target selects the Repository and storage provider. Build first when the target must include the latest Desired changes.
Synopsis
--passfile supplies signing credentials when recovering an interrupted local mutation. Publishing an already built Generation does not itself sign files. See Password files for source selection and format.
| Flag | Meaning | Default |
|---|---|---|
--abort |
Abandon an interrupted publication before its commit phase | false |
--rebind |
Confirm and record permitted target name/public endpoint/cache-TTL changes | false |
-C, --workdir DIR |
Workspace discovery start directory | current directory |
-T, --timeout DUR |
Maximum Repository-lock wait; 0 waits indefinitely |
0 |
-N, --no-wait |
Fail immediately when the lock is held | false |
--passfile PATH |
Password file for this invocation | per-key config, then SOW_GPG_PASSFILE |
--json |
Output JSON | false |
TARGET must name a configured filesystem or r2 publication target. --abort and
--rebind are mutually exclusive.
Before publication
Run build first to include the latest package and policy changes. A dirty Repository can still publish its previous completed Built Generation.
Configure the target’s web server or bucket access so that public_endpoint serves the published files. Then run sow publish TARGET.
Publication protocol
SOW verifies the local files against the completed Generation manifest, then publishes in this order:
- package files;
- metadata with content-specific URLs;
- client entry points, such as
repomd.xmlandRelease; - public visibility checks and a saved publication checkpoint.
SOW records progress so the same command can resume an interrupted publication. When the target already contains the current Generation, repeating the command changes nothing.
Rebind mutable target settings
The first publication records the Repository and target binding. After changing the target name, public endpoint, or cache TTL, use --rebind to record the updated settings and continue publication:
If you renamed the target in targets:, use its new name.
| May change | Immutable; configure a new target |
|---|---|
| target name | Repository identity |
public_endpoint |
provider, storage endpoint, or region |
max_cache_ttl |
bucket or prefix |
Complete pending target maintenance before changing max_cache_ttl, and finish active conditional-delete maintenance before changing public_endpoint. SOW scopes the prospective filesystem target path check so sibling targets that share a parent directory do not block each other. To publish to a new target for the first time, use sow publish TARGET without --rebind.
Abort and recovery
After an interruption, rerun sow publish TARGET to resume the publication.
To abandon the attempt, use sow publish TARGET --abort before it reaches commit_intent. SOW checks the objects already uploaded and records the abandonment. It leaves remote files in place. Once the attempt reaches commit_intent, rerun the ordinary publish command to finish it.
A published package URL identifies fixed content. Use a new package version and filename for changed content. If existing remote files differ from the recorded attempt, follow the reported conflict diagnosis; see Troubleshooting.
Public visibility checks
Before recording a checkpoint, SOW verifies that it can read the published files through public_endpoint. HTTP(S) verification uses ordinary GET requests, follows CDN redirects while blocking HTTPS-to-HTTP downgrades and verifying connected dial addresses against private loopback/link-local ranges, and refuses cross-origin redirects through an HTTP proxy (configure the final public URL directly or route that host without a proxy). SOW retries stale or missing content up to max_cache_ttl. Harmless foreign files outside pool/ and dists/ at the target root are ignored.
Filesystem targets support file:// or HTTP(S) public endpoints. R2 targets require HTTP(S). Each R2 publication lists the target prefix. For a known immutable object, a matching path, size, and ETag let SOW reuse its recorded SHA-256. Other objects require HEAD, with up to eight concurrent checks per page.
Actual upload progress resets the idle timeout. After cache grace, sow gc TARGET reports eligible R2 objects. Use sow gc TARGET --delete to reclaim them. See target GC.
Removing a published view
While a target remains configured, its published entry points must remain available locally, and local mutations verify that no active current, previous, or retained Generation pointer is withdrawn. These entry points include Dists, RPM architecture views, and signing companion files.
To retire that target, stop publishing to it, remove its entry from targets: in sow.yml, and run sow config check. You can then remove the local view. This leaves the old remote files and publication history intact. To publish the reduced repository, configure a new target with a different storage prefix and update clients to use it.
Exit behavior
| Code | Trigger |
|---|---|
0 |
Publication completed or target was already current |
1 |
Filesystem, provider, network, verification, or binding conflict (including required rebind) |
2 |
Usage, Workspace discovery, or invalid sow.yml error |
4 |
Repository write lock unavailable |
5 |
Local or publication recovery evidence is inconsistent, or source is not deliverable |
6 |
Target is missing/unsafe, or another safety precondition rejects publish/abort/rebind |
See also
sow statusandsow check— decide whether the Built Generation is the one you intend to deliversow gc— reclaim unused target filessow.ymltargets — provider configuration- Publication Model — phases, receipts, recovery, and cache grace