diff --git a/Jenkinsfile b/Jenkinsfile index 4c650503ba4b616bc2062cf218a1d2cd2ab67bd0..4af2c508a39e0d7440a9182f58f2caf55a4f9a74 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,6 +42,27 @@ def buildImage(architecture, type, board, debosarguments = "") { } } + if (sysroot) { + stage("${architecture} sysroot tarball") { + sh(script: """\ + cd ${PIPELINE_VERSION}/${architecture}/${type}; \ + debos ${debosarguments} \ + -t architecture:${architecture} \ + -t ospack:ospack_${release}-${architecture}-${type}_${PIPELINE_VERSION}.tar.gz \ + -t sysroot:sysroot-${architecture}.tar.gz \ + ${WORKSPACE}/apertis-sysroot.yaml""") + } + + stage("${architecture} sysroot 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} archive@images.apertis.org:/srv/images/public/sysroot/${release}/") + } + } + } + stage("${architecture} ${type} ${board} image") { sh(script: """\ cd ${PIPELINE_VERSION}/${architecture}/${type}; \ @@ -85,25 +106,28 @@ def images = [:] images["Sdk"] = buildImage("amd64", "sdk", "sdk", "--scratchsize 10G") -// Types for all boards and common debos arguments -def types = [ [ "minimal", ""], - [ "target", ""], - ["development", "--scratchsize 10G"] +// Types for all boards, common debos arguments and sysroots +def types = [ [ "minimal", "", false], + [ "target", "", false], + ["development", "--scratchsize 10G", true] ] images += types.collectEntries { [ "Amd64 ${it[0]}": buildImage("amd64", it[0], "uefi", - it[1]) ] } + it[1], + it[2]) ] } images += types.collectEntries { [ "Arm64 ${it[0]}": buildImage("arm64", it[0], "uboot", - it[1]) ] } + it[1], + it[2]) ] } images += types.collectEntries { [ "Armhf ${it[0]}": buildImage("armhf", it[0], "uboot", - it[1]) ] } + it[1], + it[2]) ] } parallel images diff --git a/apertis-sysroot.yaml b/apertis-sysroot.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1b5c1bcb021e18dba06ec20620dae418763f0304 --- /dev/null +++ b/apertis-sysroot.yaml @@ -0,0 +1,20 @@ +{{ $architecture := or .architecture "armhf" }} +{{ $ospack := or .ospack (printf "ospack-%s.tar.gz" $architecture) }} +{{ $sysroot := or .sysroot (printf "sysroot-%s.tar.gz" $architecture) }} + +architecture: {{ $architecture }} + +actions: + + - action: unpack + description: Unpack {{ $ospack }} + compression: gz + file: {{ $ospack }} + + - action: run + chroot: true + command: symlinks -rc / + + - action: pack + compression: gz + file: {{ $sysroot }}