Various scripts for operating on an OSTree repository
Switch branches/tags
Nothing to show
Clone or download
cgwalters rsync-repos: Fix regression from previous commit
We were missing `--delete`, etc.
Latest commit d7d3984 Jun 21, 2018

Scripts for release engineering operations on OSTree repositories

These scripts are intended for use by organizations that provide OSTree repositories, automating workflow operations around release engineering.


This implements a "binary promotion model" of commits across separate branches, similar to what's described in the ostree manual. This script is used by CentOS Atomic Host Development. See the releases.yml file there.

To use this, you should store the releases.yml file in git, and ensure that do-release-tags is executed from a CI system like Jenkins.


A simpler pattern is to have an internal repository which has at most one new commit, which isn't exposed publicly. This script maintains a redhat.staging detached metadata key, and will undo the topmost commit if it has that key.

To use this, just run it before your build system generates a commit.


While you certainly can invoke rsync against a whole OSTree repo, there will be race conditions if any client systems are accessing it concurrently. This script wraps rsync to close those races.

Note that if you have concurrent writes on the repo, and particularly if you want to do pruning, a best practice for using this is to use ostree to create a local snapshot. Like this:

ostree --repo=repo.tmp init --mode=archive
ostree --repo=repo.tmp pull-local repo
ostree --repo=repo.tmp prune --refs-only --keep-younger-than='30 days ago'
ostree --repo=repo.tmp summary -u
./rsync-repos repo.tmp/
rm repo.tmp -rf

Since with this model the prunes are only happening in the public copy, you'll want to periodically halt writes to the internal copy, and reverse the rsync direction.


Generate statistics on the files in a given commit.


Directly change a given ref, with no verification.