lib/deploy: Do post-ops when removing staged commit

These are further fixes based on running more of the rpm-ostree
test suite.

When dropping the staged deployment, we do need to do the
"post operations" such as bumping the sysroot mtime, so that
clients know something changed.  We also need to regenerate
the deployment refs.  And of course do a sysroot reload.

Also, add a "base cleanup" after creating a staged deployment
which also regenerates the refs.

Closes: #1570
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2018-05-02 16:22:34 +00:00
1 parent 25ba8db987
commit 5337ba51b2
2 files changed
+53 -9

No files matched your search

@@ -4,8 +4,19 @@
- name: Write staged-deploy commit
shell: |
ostree --repo=/ostree/repo commit --parent="${commit}" -b staged-deploy --tree=ref="${commit}" --no-bindings
newcommit=$(ostree rev-parse staged-deploy)
orig_mtime=$(stat -c '%.Y' /sysroot/ostree/deploy)
ostree admin deploy --stage staged-deploy
new_mtime=$(stat -c '%.Y' /sysroot/ostree/deploy)
assert_not_streq "${orig_mtime}" "${new_mtime}"
test -f /run/ostree/staged-deployment
ostree refs | grep -E -e '^ostree/' | while read ref; do
if test "$(ostree rev-parse ${ref})" = "${newcommit}"; then
touch deployment-ref-found
fi
done
test -f deployment-ref-found
rm deployment-ref-found
environment:
commit: "{{ rpmostree_status['deployments'][0]['checksum'] }}"
- include_tasks: ../tasks/reboot.yml