Skip to content
Snippets Groups Projects
Commit 9fb2d181 authored by Frédéric Dalleau's avatar Frédéric Dalleau
Browse files

Generate ostree static delta for rollback test


The test ostree commit is generated after the successful commit.
Removing updatectl, it makes it impossible to mark an update successful.
Hence the bootcount will be increased at each boot, eventually causing
rollback to the previous deployment.

Ostree provides --skip-list that allows to create a commit with a list
of files to skip. That is useful to generate the rollback commit.
This way there is not need to modify existing recipes or provide
additional one. The execution time is also very short.

Signed-off-by: default avatarFrédéric Dalleau <frederic.dalleau@collabora.com>
parent 4bca9b86
No related branches found
No related tags found
1 merge request!73Generate ostree static delta for rollback test
......@@ -268,6 +268,26 @@ def buildOStree(architecture, type, board, debosarguments = "", repo = "repo") {
--filename ${image_name}.delta""")
}
def buildOStreeRollbackDelta(architecture, type, board, debosarguments = "", repo = "repo") {
def image_name = imageName(architecture, type, board, true)
def branch = "${osname}/${release}/${architecture}-${board}/${type}"
def rollback_branch = "${osname}/${release}/${architecture}-${board}/${type}-rollback"
sh(script: """
cd ${PIPELINE_VERSION}/${architecture}/${type}
echo "/usr/bin/updatectl" > skip_list
ostree --repo=${repo} commit \
--tree=ref=${branch} \
--branch=${rollback_branch} \
--skip-list="skip_list"
ostree --repo=${repo} static-delta generate \
--from=${branch} \
--to=${rollback_branch} \
--inline \
--min-fallback-size=1024 \
--filename ${image_name}_rollback.delta""")
}
/** Generate the image name
*
* To have a single place for image name generation.
......@@ -323,6 +343,7 @@ def buildOStreeImage(architecture, type, board, debosarguments = "") {
stage("${architecture} ${type} ${board} OStree image build") {
buildOStree(architecture, type, board, debosarguments, repo)
buildOStreeRollbackDelta(architecture, type, board, debosarguments, repo)
sh(script: """
cd ${PIPELINE_VERSION}/${architecture}/${type}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment