Skip to content
Snippets Groups Projects
Commit b18228c4 authored by Denis Pynkin's avatar Denis Pynkin
Browse files

Use ostree-push to publish prepared repository


Switch to `ostree-push` instead of `rsync` allows to keep
all branches in single repository.

Naming convention for branches includes release number for now:
- apertis/${release}/${architecture}-${board}/${type}

Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>
Reviewed-by: default avatarSjoerd Simons <sjoerd.simons@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D7542
parent 2b1f1095
Branches apertis/v2022dev3 apertis/v2022pre apertis/v2023dev0
Tags apertis/1.15.9-6+apertis0
No related merge requests found
......@@ -140,13 +140,15 @@ def buildImage(architecture, type, board, debosarguments = "", sysroot = false,
def buildOStree(architecture, type, board, debosarguments = "", production = false) {
stage("${architecture} ${type} ${board} OStree repo pull") {
// Allow to work with not-existing branches
// ostree-push below refuses to update ostree branch if `ostree pull` failed by any other reason
sh(script: """\
cd ${PIPELINE_VERSION}/${architecture}/${type}; \
rm -rf repo; \
mkdir repo; \
ostree init --repo=repo --mode archive-z2;
ostree remote --repo=repo add --no-gpg-verify origin https://images.apertis.org/ostree/${architecture}-${board}-${type};
ostree pull --repo=repo origin apertis/${architecture}-${board}/${type}""")
ostree remote --repo=repo add --no-gpg-verify origin https://images.apertis.org/ostree/repo;
ostree pull --repo=repo origin apertis/${release}/${architecture}-${board}/${type} || true""")
}
stage("${architecture} ${type} ${board} OStree commit") {
......@@ -163,10 +165,18 @@ def buildOStree(architecture, type, board, debosarguments = "", production = fal
ostree --repo=repo summary -u""")
}
stage("${architecture} ${type} ${board} OStree upload") {
uploadDirectory("${env.PIPELINE_VERSION}/${architecture}/${type}/repo/", "ostree/${architecture}-${board}-${type}", production)
stage("${architecture} ${type} ${board} OStree push") {
if (!production) {
println "Skipping push of OStree to apertis/${architecture}-${board}/${type}"
return
}
sshagent (credentials: [ "5a23cd79-e26d-41bf-9f91-d756c131b811", ] ) {
env.NSS_WRAPPER_PASSWD = "/tmp/passwd"
env.NSS_WRAPPER_GROUP = '/dev/null'
sh(script: 'echo docker:x:$(id -u):$(id -g):docker gecos:/tmp:/bin/false > ${NSS_WRAPPER_PASSWD}')
sh(script: "LD_PRELOAD=libnss_wrapper.so ostree-push --repo ${env.PIPELINE_VERSION}/${architecture}/${type}/repo/ archive@images.apertis.org:/srv/images/public/ostree/repo/ apertis/${release}/${architecture}-${board}/${type}")
}
}
}
def buildContainer(architecture, type, board, debosarguments = "", production = false) {
......
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