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

Generate an 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.

Signed-off-by: default avatarFrédéric Dalleau <frederic.dalleau@collabora.com>

Make a separate recipe from the test commit

Signed-off-by: default avatarFrédéric Dalleau <frederic.dalleau@collabora.com>
parent 2d8cdca9
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !73. Comments created here will be created in the context of that merge request.
......@@ -264,6 +264,37 @@ 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}
debos ${debosarguments} \
--show-boot \
-t architecture:${architecture} \
-t type:$type \
-t board:$board \
-t suite:$release \
-t ospack:ospack_${release}-${architecture}-${type}_${PIPELINE_VERSION} \
-t image:${image_name} \
-t message:${release}-${type}-${architecture}-${board}_${PIPELINE_VERSION} \
-t ostree:${repo} \
${WORKSPACE}/${osname}-ostree-commit.yaml""")
sh(script: """
cd ${PIPELINE_VERSION}/${architecture}/${type}
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.
......@@ -321,6 +352,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}
......
{{ $architecture := or .architecture "amd64" }}
{{ $type := or .type "minimal" }}
{{ $suite := or .suite "18.12" }}
{{ $image := or .image (printf "apertis-ostree-%s-%s-%s" $suite $type $architecture) }}
{{ $board := or .board "uefi" }}
{{ $repourl := or .repourl "https://images.apertis.org/ostree/repo" }}
{{ $osname := or .osname "apertis" }}
{{ $branch := or .branch (printf "%s/%s/%s-%s/%s-rollback" $osname $suite $architecture $board $type) }}
{{ $ostree := or .ostree "repo" }}
architecture: {{ $architecture }}
actions:
- action: ostree-deploy
description: Deploying ostree onto image
repository: {{ $ostree }}
remote_repository: {{ $repourl }}
branch: {{ $branch }}
os: {{ $osname }}
append-kernel-cmdline: {{ $cmdline }}
- action: run
chroot: false
command: "rm ${ROOTDIR}/usr/bin/updatectl"
- action: ostree-commit
repository: {{ $ostree }}
branch: {{ $branch }}
subject: {{ $message }} rollback test commit
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