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

Add ostree to Jenkinsfile


Add ostree creation and publishing at images.a.o.

Signed-off-by: default avatarDenis Pynkin <denis.pynkin@collabora.com>

Differential Revision: https://phabricator.apertis.org/D7340
parent caa5111f
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ properties( ...@@ -6,7 +6,7 @@ properties(
] ]
) )
def buildImage(architecture, type, board, debosarguments = "", sysroot = false) { def buildImage(architecture, type, board, debosarguments = "", sysroot = false, ostree = false) {
return { return {
node("docker-slave") { node("docker-slave") {
checkout scm checkout scm
...@@ -82,6 +82,42 @@ def buildImage(architecture, type, board, debosarguments = "", sysroot = false) ...@@ -82,6 +82,42 @@ def buildImage(architecture, type, board, debosarguments = "", sysroot = false)
sh(script: "LD_PRELOAD=libnss_wrapper.so rsync -e \"ssh -oStrictHostKeyChecking=no\" -aP ${PIPELINE_VERSION} archive@images.apertis.org:/srv/images/public/daily/debos/${release}/") sh(script: "LD_PRELOAD=libnss_wrapper.so rsync -e \"ssh -oStrictHostKeyChecking=no\" -aP ${PIPELINE_VERSION} archive@images.apertis.org:/srv/images/public/daily/debos/${release}/")
} }
} }
if (ostree) {
stage("${architecture} ${type} OStree repo pull") {
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}-generic-${type};
ostree pull --repo=repo origin apertis/${architecture}-generic/${type}""")
}
stage("${architecture} ${type} OStree commit") {
sh(script: """\
cd ${PIPELINE_VERSION}/${architecture}/${type}; \
debos ${debosarguments} \
-t architecture:${architecture} \
-t type:$type \
-t suite:$release \
-t ospack:ospack_${release}-${architecture}-${type}_${PIPELINE_VERSION}.tar.gz \
-t message:${release}-${type}-${architecture}-${board}_${PIPELINE_VERSION} \
${WORKSPACE}/apertis-ostree-commit.yaml;
ostree --repo=repo summary -u""")
}
stage("${architecture} ${type} OStree upload") {
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 rsync -e \"ssh -oStrictHostKeyChecking=no\" -aP ${PIPELINE_VERSION}/${architecture}/${type}/repo/ archive@images.apertis.org:/srv/images/public/ostree/${architecture}-generic-${type}/")
}
}
}
} finally { } finally {
stage("Cleanup ${architecture} ${type}") { stage("Cleanup ${architecture} ${type}") {
deleteDir() deleteDir()
...@@ -107,28 +143,31 @@ def images = [:] ...@@ -107,28 +143,31 @@ def images = [:]
images["Sdk"] = buildImage("amd64", "sdk", "sdk", "--scratchsize 10G") images["Sdk"] = buildImage("amd64", "sdk", "sdk", "--scratchsize 10G")
// Types for all boards, common debos arguments and sysroots // Types for all boards, common debos arguments, sysroots and
def types = [ [ "minimal", "", false], def types = [ [ "minimal", "", false, true],
[ "target", "", false], [ "target", "", false, true],
["development", "--scratchsize 10G", true] [ "development", "--scratchsize 10G", false, false]
] ]
images += types.collectEntries { [ "Amd64 ${it[0]}": buildImage("amd64", images += types.collectEntries { [ "Amd64 ${it[0]}": buildImage("amd64",
it[0], it[0],
"uefi", "uefi",
it[1], it[1],
it[2]) ] } it[2],
it[3]) ] }
images += types.collectEntries { [ "Arm64 ${it[0]}": buildImage("arm64", images += types.collectEntries { [ "Arm64 ${it[0]}": buildImage("arm64",
it[0], it[0],
"uboot", "uboot",
it[1], it[1],
it[2]) ] } it[2],
it[3]) ] }
images += types.collectEntries { [ "Armhf ${it[0]}": buildImage("armhf", images += types.collectEntries { [ "Armhf ${it[0]}": buildImage("armhf",
it[0], it[0],
"uboot", "uboot",
it[1], it[1],
it[2]) ] } it[2],
it[3]) ] }
parallel images parallel images
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