Re: How to find versions from ostree repo



On Mon, Aug 6, 2018 at 8:43 AM, Cristian Falcas via ostree-list
<ostree-list gnome org> wrote:
Hello,

Where is the version for a specific commit kept in the repo?

I can see the commit at
$REPONAME/refs/heads/fedora/27/x86_64/atomic-host-kubernetes, but I can't
find the version. For me it's something like this:
```
# rpm-ostree status
State: idle; auto updates disabled
Deployments:
* ostree://our_custom_repo:fedora/27/x86_64/atomic-host-kubernetes
                   Version: 27.20180801_1740.0 (2018-08-03 15:00:29)
                    Commit:
86370353a42b9dc68acab17a4b950a23af4ac1eb63af10bb162ff3c00a4ff210
              GPGSignature: Valid signature by
3A362F3C67B04FEBF704CDA84F34A4152F54FEF1
```

The version is kept in the commit metadata key version. You can get it
out with show --print-metadata-key. Here's an example in the Endless
OS repo:

$ ostree show --print-metadata-key=version os/eos/amd64/eos3a
'3.4.6'

Also, I'm trying to keep the repo in s3, and for this I'm doing something
like:

```
rpm-ostree compose tree --cachedir=/srv/cache --repo=$REPONAME
/srv/fedora-atomic//fedora-atomic-kubernetes.json
aws s3 sync $REPONAME s3://$S3BUCKET/$REPONAME --acl public-read
```

But this always keeps only the latest version. Is there a way to make
rpm-ostree keep all versions built? I copied the file
$REPONAME/refs/heads/fedora/27/x86_64/atomic-host-kubernetes to a new build,
but the content is overwritten.

This is dependent on how rpm-ostree makes commits. If it keeps
history, then the old versions are just ancestors to the
fedora/27/x86_64/atomic-host-kubernetes ref. But maybe rpm-ostree
compose prunes all but the latest commit. You'd have to look at what
rpm-ostree does, but you can run ostree log from the local repo to
see:

ostree --repo=$REPONAME log fedora/27/x86_64/atomic-host-kubernetes

If there are multiple commits, then you can reference them by adding ^
after the ref sort of like git. For example,
fedora/27/x86_64/atomic-host-kubernetes^^ would be two commits prior
to the ref head.

--
Dan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]