-
-
Save nzwulfin/91dab312d35e103641b3bebb739da8b0 to your computer and use it in GitHub Desktop.
## Set up new branch based on existing tree and deploy | |
sudo ostree commit -b synthetic_test --tree=ref=fedora-atomic:fedora-atomic/24/x86_64/docker-host | tee target_commit.txt | |
sudo ostree admin deploy synthetic_test | |
sudo systemctl reboot | |
atomic host status | |
<active commit == target_commit.txt> | |
## Create a 'noop' commit based on the new branch as an upgrade target | |
sudo ostree commit -b synthetic_test --tree=ref=synthetic_test | tee target_upgrade.txt | |
sudo atomic host upgrade | |
sudo systemctl reboot | |
atomic host status | |
<active commit == target_upgrade.txt> | |
## Rollback to new branch | |
sudo atomic host rollback | |
sudo systemctl reboot | |
atomic host status | |
<active commit == target_commit.txt> |
@jlebon, yes that will help a lot for parsing. Will investigate for current atomic
and rpm-ostree
support for json output. That will also be easier to determine which commit id is booted, etc.
python synth_setup.py && atomic host status
sudo systemctl reboot
python synth_upgrade.py && atomic host status
sudo systemctl reboot
python synth_rollback.py && atomic host status
sudo systemctl reboot
Tests look sane. I'd add a follow-up check that the commit you rolled back to is indeed what you expect it to be.
Also note that instead of ostree admin deploy, you can use rpm-ostree rebase $ref, which also has a --reboot option. (All the other rpm-ostree commands used here also have a similar --reboot option, which might simplify your life).
I'm rethinking the setup portion to create the new tree, deploy it, create the updated tree, then reboot
This seems to work the way we'll need it to in Tunir
If you're planning to transform this to Python, consider using the output of
rpm-ostree status --json
instead (though I think theatomic host
wrapper also supports--json
) to retrieve the current ref you're sitting on, rather than hardcoding it.