Jenkinsfiles: integrated updating only netmodule layers in split job files

Within the big jenkins file only the netmodule layers are updated
when the release string is empty of latest. This change is now
integrated into the split jenkins files.

BugzID: 73564
Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmueller 2021-07-06 16:18:35 +02:00
parent 8a477f0117
commit 9321361765
5 changed files with 15 additions and 20 deletions

View File

@ -30,15 +30,16 @@ def isRelease(versionParam) {
} }
def handleSubmodules(isForcedToHead) { def handleSubmodules(versionParam) {
println "init submodules..." println "init submodules..."
sh 'git submodule init' sh 'git submodule update --init'
if(isForcedToHead) { if(isRelease(versionparam)) {
println "setting submodule hashes to head..." println "set submodules to freezed state..."
sh 'git submodule update --remote --rebase' // update all submodules to HEAD sh 'git submodule update' // set all submodules to freezed commit
} }
else { else {
sh 'git submodule update' // set all submodules to freezed commit println "setting netmodule submodule hashes to head..."
sh 'git submodule update --remote --rebase meta-netmodule-*' // update our own submodules to HEAD
} }
submoduleStatus = sh(returnStdout: true, script: "git submodule status").trim() // print submodule hashes to jenkins log submoduleStatus = sh(returnStdout: true, script: "git submodule status").trim() // print submodule hashes to jenkins log
println "${submoduleStatus}" println "${submoduleStatus}"

View File

@ -17,7 +17,6 @@ pipeline {
choice(name: 'IMAGE_TYPE', choices: ['lava', 'fct', 'minimal'], description: 'choose image type') choice(name: 'IMAGE_TYPE', choices: ['lava', 'fct', 'minimal'], description: 'choose image type')
string(name: 'RLS_VERSION', defaultValue: '', description: 'Set the version to build and use committed submodules') string(name: 'RLS_VERSION', defaultValue: '', description: 'Set the version to build and use committed submodules')
booleanParam(name: 'CLEAN_BUILD', defaultValue: false, description: 'clean all temp directories before build starts') booleanParam(name: 'CLEAN_BUILD', defaultValue: false, description: 'clean all temp directories before build starts')
booleanParam(name: 'DO_UPDATE_TO_HEAD', defaultValue: false, description: 'update submodules to head')
} }
environment { environment {
@ -50,7 +49,7 @@ pipeline {
// Prepare Build Environment // Prepare Build Environment
env.YOCTO_DEPLOYS = "${env.BUILD_DEPLOY_DIR}/${params.MACHINE}" env.YOCTO_DEPLOYS = "${env.BUILD_DEPLOY_DIR}/${params.MACHINE}"
yoctocommon.handleSubmodules(params.DO_UPDATE_TO_HEAD) yoctocommon.handleSubmodules("${params.RLS_VERSION}")
version = yoctocommon.getVersionString("${params.RLS_VERSION}", "${params.IMAGE_TYPE}") version = yoctocommon.getVersionString("${params.RLS_VERSION}", "${params.IMAGE_TYPE}")
env.BUILD_VERSION = "${version}" env.BUILD_VERSION = "${version}"
currentBuild.displayName = "${version}-${params.MACHINE}-${params.IMAGE_TYPE}" //replace Bitbake timestamp after building currentBuild.displayName = "${version}-${params.MACHINE}-${params.IMAGE_TYPE}" //replace Bitbake timestamp after building
@ -112,7 +111,6 @@ def printJobParameters() {
MACHINE = ${params.MACHINE}\n\ MACHINE = ${params.MACHINE}\n\
IMAGE_TYPE = ${params.IMAGE_TYPE}\n\ IMAGE_TYPE = ${params.IMAGE_TYPE}\n\
CLEAN_BUILD = ${params.CLEAN_BUILD}\n\ CLEAN_BUILD = ${params.CLEAN_BUILD}\n\
UPDATE_TO_HEAD = ${params.DO_UPDATE_TO_HEAD}\n\
RLS_VERSION = ${params.RLS_VERSION}\n\ RLS_VERSION = ${params.RLS_VERSION}\n\
--> version = ${env.BUILD_VERSION}\n\ --> version = ${env.BUILD_VERSION}\n\
----------------------------------\n" ----------------------------------\n"

View File

@ -17,7 +17,6 @@ pipeline {
choice(name: 'IMAGE_TYPE', choices: ['dev', 'bootloader', 'release'], description: 'choose image type') choice(name: 'IMAGE_TYPE', choices: ['dev', 'bootloader', 'release'], description: 'choose image type')
string(name: 'RLS_VERSION', defaultValue: '', description: 'Set the version to build and use committed submodules') string(name: 'RLS_VERSION', defaultValue: '', description: 'Set the version to build and use committed submodules')
booleanParam(name: 'CLEAN_BUILD', defaultValue: false, description: 'clean all temp directories before build starts') booleanParam(name: 'CLEAN_BUILD', defaultValue: false, description: 'clean all temp directories before build starts')
booleanParam(name: 'DO_UPDATE_TO_HEAD', defaultValue: false, description: 'update submodules to head')
} }
environment { environment {
@ -50,7 +49,7 @@ pipeline {
// Prepare Build Environment // Prepare Build Environment
env.YOCTO_DEPLOYS = "${env.BUILD_DEPLOY_DIR}/${params.MACHINE}" env.YOCTO_DEPLOYS = "${env.BUILD_DEPLOY_DIR}/${params.MACHINE}"
yoctocommon.handleSubmodules(params.DO_UPDATE_TO_HEAD) yoctocommon.handleSubmodules("${params.RLS_VERSION}")
version = yoctocommon.getVersionString("${params.RLS_VERSION}", "${params.IMAGE_TYPE}") version = yoctocommon.getVersionString("${params.RLS_VERSION}", "${params.IMAGE_TYPE}")
env.BUILD_VERSION = "${version}" env.BUILD_VERSION = "${version}"
currentBuild.displayName = "${version}-${params.MACHINE}-${params.IMAGE_TYPE}" //replace Bitbake timestamp after building currentBuild.displayName = "${version}-${params.MACHINE}-${params.IMAGE_TYPE}" //replace Bitbake timestamp after building
@ -113,7 +112,6 @@ def printJobParameters() {
MACHINE = ${params.MACHINE}\n\ MACHINE = ${params.MACHINE}\n\
IMAGE_TYPE = ${params.IMAGE_TYPE}\n\ IMAGE_TYPE = ${params.IMAGE_TYPE}\n\
CLEAN_BUILD = ${params.CLEAN_BUILD}\n\ CLEAN_BUILD = ${params.CLEAN_BUILD}\n\
UPDATE_TO_HEAD = ${params.DO_UPDATE_TO_HEAD}\n\
RLS_VERSION = ${params.RLS_VERSION}\n\ RLS_VERSION = ${params.RLS_VERSION}\n\
--> version = ${env.BUILD_VERSION}\n\ --> version = ${env.BUILD_VERSION}\n\
----------------------------------\n" ----------------------------------\n"

View File

@ -16,7 +16,6 @@ pipeline {
choice(name: 'MACHINE', choices: ['select...', 'am335x-nrhw20', 'am335x-nmhw21', 'imx8-nmhw23', 'am335x-nmhw24', 'am335x-hw25', 'am335x-hw26'], description: 'choose target platform') choice(name: 'MACHINE', choices: ['select...', 'am335x-nrhw20', 'am335x-nmhw21', 'imx8-nmhw23', 'am335x-nmhw24', 'am335x-hw25', 'am335x-hw26'], description: 'choose target platform')
string(name: 'RLS_VERSION', defaultValue: '', description: 'Set the version to build and use committed submodules') string(name: 'RLS_VERSION', defaultValue: '', description: 'Set the version to build and use committed submodules')
booleanParam(name: 'CLEAN_BUILD', defaultValue: false, description: 'clean all temp directories before build starts') booleanParam(name: 'CLEAN_BUILD', defaultValue: false, description: 'clean all temp directories before build starts')
booleanParam(name: 'DO_UPDATE_TO_HEAD', defaultValue: true, description: 'update submodules to head')
booleanParam(name: 'BUILD_FROM_DEV_IMAGE', defaultValue: false, description: 'build SDK from dev image') booleanParam(name: 'BUILD_FROM_DEV_IMAGE', defaultValue: false, description: 'build SDK from dev image')
} }
@ -51,7 +50,7 @@ pipeline {
// Prepare Build Environment // Prepare Build Environment
env.YOCTO_DEPLOYS = "${env.SHARED_BUILD}/tmp/deploy/sdk" env.YOCTO_DEPLOYS = "${env.SHARED_BUILD}/tmp/deploy/sdk"
yoctocommon.handleSubmodules(params.DO_UPDATE_TO_HEAD) yoctocommon.handleSubmodules("${params.RLS_VERSION}")
version = yoctocommon.getVersionString("${params.RLS_VERSION}", "sdk") version = yoctocommon.getVersionString("${params.RLS_VERSION}", "sdk")
env.BUILD_VERSION = "${version}" env.BUILD_VERSION = "${version}"
currentBuild.displayName = "${version}-${params.MACHINE}-sdk" //replace Bitbake timestamp after building currentBuild.displayName = "${version}-${params.MACHINE}-sdk" //replace Bitbake timestamp after building
@ -116,7 +115,6 @@ def printJobParameters() {
----------------------------------\n\ ----------------------------------\n\
MACHINE = ${params.MACHINE}\n\ MACHINE = ${params.MACHINE}\n\
CLEAN_BUILD = ${params.CLEAN_BUILD}\n\ CLEAN_BUILD = ${params.CLEAN_BUILD}\n\
UPDATE_TO_HEAD = ${params.DO_UPDATE_TO_HEAD}\n\
IS_NM_LINUX_SDK = ${env.IS_NM_LINUX_SDK}\n\ IS_NM_LINUX_SDK = ${env.IS_NM_LINUX_SDK}\n\
RLS_VERSION = ${params.RLS_VERSION}\n\ RLS_VERSION = ${params.RLS_VERSION}\n\
--> version = ${env.BUILD_VERSION}\n\ --> version = ${env.BUILD_VERSION}\n\

View File

@ -62,11 +62,11 @@ pipeline {
def printJobParameters() { def printJobParameters() {
println "----------------------------------\n\ println "----------------------------------\n\
Job Parameters:\n\ Job Parameters:\n\
----------------------------------\n\ ----------------------------------\n\
UPDATE_NM_PARTS = ${params.UPDATE_NM_PARTS}\n\ UPDATE_NM_PARTS = ${params.UPDATE_NM_PARTS}\n\
UPDATE_COMMUNITY_PARTS = ${params.UPDATE_COMMUNITY_PARTS}\n\ UPDATE_COMMUNITY_PARTS = ${params.UPDATE_COMMUNITY_PARTS}\n\
----------------------------------\n" ----------------------------------\n"
} }
def prepareUpdate() { def prepareUpdate() {