diff --git a/Jenkinsfile_Common b/Jenkinsfile_Common index 07f48eb..7df827c 100644 --- a/Jenkinsfile_Common +++ b/Jenkinsfile_Common @@ -30,15 +30,16 @@ def isRelease(versionParam) { } -def handleSubmodules(isForcedToHead) { +def handleSubmodules(versionParam) { println "init submodules..." - sh 'git submodule init' - if(isForcedToHead) { - println "setting submodule hashes to head..." - sh 'git submodule update --remote --rebase' // update all submodules to HEAD + sh 'git submodule update --init' + if(isRelease(versionparam)) { + println "set submodules to freezed state..." + sh 'git submodule update' // set all submodules to freezed commit } 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 println "${submoduleStatus}" diff --git a/Jenkinsfile_RamdiskImages b/Jenkinsfile_RamdiskImages index f672d8e..832392b 100644 --- a/Jenkinsfile_RamdiskImages +++ b/Jenkinsfile_RamdiskImages @@ -17,7 +17,6 @@ pipeline { 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') 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 { @@ -50,7 +49,7 @@ pipeline { // Prepare Build Environment 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}") env.BUILD_VERSION = "${version}" currentBuild.displayName = "${version}-${params.MACHINE}-${params.IMAGE_TYPE}" //replace Bitbake timestamp after building @@ -112,7 +111,6 @@ def printJobParameters() { MACHINE = ${params.MACHINE}\n\ IMAGE_TYPE = ${params.IMAGE_TYPE}\n\ CLEAN_BUILD = ${params.CLEAN_BUILD}\n\ - UPDATE_TO_HEAD = ${params.DO_UPDATE_TO_HEAD}\n\ RLS_VERSION = ${params.RLS_VERSION}\n\ --> version = ${env.BUILD_VERSION}\n\ ----------------------------------\n" diff --git a/Jenkinsfile_mmcImages b/Jenkinsfile_mmcImages index 55049e4..a97ab3e 100644 --- a/Jenkinsfile_mmcImages +++ b/Jenkinsfile_mmcImages @@ -17,7 +17,6 @@ pipeline { 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') 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 { @@ -50,7 +49,7 @@ pipeline { // Prepare Build Environment 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}") env.BUILD_VERSION = "${version}" currentBuild.displayName = "${version}-${params.MACHINE}-${params.IMAGE_TYPE}" //replace Bitbake timestamp after building @@ -113,7 +112,6 @@ def printJobParameters() { MACHINE = ${params.MACHINE}\n\ IMAGE_TYPE = ${params.IMAGE_TYPE}\n\ CLEAN_BUILD = ${params.CLEAN_BUILD}\n\ - UPDATE_TO_HEAD = ${params.DO_UPDATE_TO_HEAD}\n\ RLS_VERSION = ${params.RLS_VERSION}\n\ --> version = ${env.BUILD_VERSION}\n\ ----------------------------------\n" diff --git a/Jenkinsfile_sdk b/Jenkinsfile_sdk index 8a2d086..5ad2862 100644 --- a/Jenkinsfile_sdk +++ b/Jenkinsfile_sdk @@ -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') 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: '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') } @@ -51,7 +50,7 @@ pipeline { // Prepare Build Environment 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") env.BUILD_VERSION = "${version}" currentBuild.displayName = "${version}-${params.MACHINE}-sdk" //replace Bitbake timestamp after building @@ -116,7 +115,6 @@ def printJobParameters() { ----------------------------------\n\ MACHINE = ${params.MACHINE}\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\ RLS_VERSION = ${params.RLS_VERSION}\n\ --> version = ${env.BUILD_VERSION}\n\ diff --git a/Jenkinsfile_update2head b/Jenkinsfile_update2head index 528a049..6526c1f 100644 --- a/Jenkinsfile_update2head +++ b/Jenkinsfile_update2head @@ -62,11 +62,11 @@ pipeline { def printJobParameters() { println "----------------------------------\n\ - Job Parameters:\n\ - ----------------------------------\n\ - UPDATE_NM_PARTS = ${params.UPDATE_NM_PARTS}\n\ - UPDATE_COMMUNITY_PARTS = ${params.UPDATE_COMMUNITY_PARTS}\n\ - ----------------------------------\n" + Job Parameters:\n\ +----------------------------------\n\ + UPDATE_NM_PARTS = ${params.UPDATE_NM_PARTS}\n\ + UPDATE_COMMUNITY_PARTS = ${params.UPDATE_COMMUNITY_PARTS}\n\ +----------------------------------\n" } def prepareUpdate() {