summaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>2022-10-20 15:24:53 +0200
committerQuentin Schulz <quentin.schulz@theobroma-systems.com>2022-10-25 13:15:36 +0200
commit89cfce18161eea789adba2761bb58e678fb18c0a (patch)
tree28f303b522d7ca5805342ba69808fb0239861769 /Jenkinsfile
parent6a88c25bf9f89e096abc061a9c43660a25336d94 (diff)
Jenkinsfile: explicit machine to build with kas with Jenkins parameter
While kas-theobroma.yml contains the default machine, KAS_MACHINE allows to overwrite it from the command line which is much more explicit in a Jenkinsfile, so let's do that. This incidentally also prepares for building multiple machines from the same Jenkinsfile. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile10
1 files changed, 6 insertions, 4 deletions
diff --git a/Jenkinsfile b/Jenkinsfile
index 293edf7..53a1b16 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -5,6 +5,7 @@
*
* Use the Jenkins configuration
*
+ * Parametrized Build -> Choice-Parameter -> YOCTO_MACHINE
* Pipeline ->
* Do not allow concurrent builds: <checked>
* Definition: Pipeline from SCM ->
@@ -22,6 +23,7 @@ pipeline {
environment {
JENKINS_USER_ID = "${sh(script:'id -u', returnStdout: true).trim()}"
JENKINS_GROUP_ID = "${sh(script:'id -g', returnStdout: true).trim()}"
+ KAS_MACHINE = "${params.YOCTO_MACHINE == null ? "puma-haikou" : params.YOCTO_MACHINE}"
}
/* BEGIN: Make sure workspace is empty for clean build */
options {
@@ -45,7 +47,7 @@ pipeline {
docker {
image 'siemens/kas/kas:3.1'
registryUrl 'https://ghcr.io/'
- args '--userns=keep-id -e USER_ID=${JENKINS_USER_ID} -e GROUP_ID=${JENKINS_GROUP_ID} --tmpfs /tmp'
+ args '--userns=keep-id -e USER_ID=${JENKINS_USER_ID} -e GROUP_ID=${JENKINS_GROUP_ID} -e KAS_MACHINE --tmpfs /tmp'
label 'docker'
/* Make sure the Jenkins node where user's UID and GID are collected is the same as the one running the actual job */
reuseNode true
@@ -64,10 +66,10 @@ pipeline {
}
stage('Archive') {
steps {
- dir('build/tmp/deploy/images/puma-haikou/') {
+ dir("build/tmp/deploy/images/$KAS_MACHINE/") {
/* Note: symlinks aren't followed, one needs to archive both the symlink and what it points to */
- archiveArtifacts 'core-image-minimal-puma-haikou*.wic'
- archiveArtifacts 'core-image-minimal-puma-haikou*.wic.bmap'
+ archiveArtifacts 'core-image-minimal-*.wic'
+ archiveArtifacts 'core-image-minimal-*.wic.bmap'
archiveArtifacts artifacts: 'fitImage*.bin', excludes: 'fitImage*linux.bin*'
archiveArtifacts 'fitImage'
archiveArtifacts 'idbloader.img*'