From d34fa204e1660e533b016ab7e07321b6c734e198 Mon Sep 17 00:00:00 2001 From: Marc Mattmueller Date: Tue, 6 Jul 2021 11:38:28 +0200 Subject: [PATCH] jenkinsfile_update2head: added info about updated layers to commit msg BugzID: 73574 Signed-off-by: Marc Mattmueller --- Jenkinsfile_update2head | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile_update2head b/Jenkinsfile_update2head index eeca411..ea162eb 100644 --- a/Jenkinsfile_update2head +++ b/Jenkinsfile_update2head @@ -47,7 +47,7 @@ pipeline { stage('commit') { steps { - commitChanges() + commitChanges(params.UPDATE_NM_PARTS, params.UPDATE_COMMUNITY_PARTS) } post { success { @@ -93,21 +93,22 @@ def prepareUpdate() { } def updateSubmodules(isNmUpdate, isCommunityUpdate) { - def updatedPart = "" if(isNmUpdate) { - sh(script: "git submodule update --remote --rebase meta-netmodule-*" - updatedPart = "netmodule" + sh(script: "git submodule update --remote --rebase meta-netmodule-*") } if(isCommunityUpdate) { sh(script: "git submodule update --remote --rebase \$(git submodule status | grep -v \"meta-netmodule-*\" | sed 's/^ *//g' | cut -d' ' -f2)") - updatedPart = "community" } submoduleStatus = sh(returnStdout: true, script: "git submodule status").trim() // print submodule hashes to jenkins log println "${submoduleStatus}" writeFile(file: "${env.SUBMODULE_VERION_FILE}", text: "${submoduleStatus}") } -def commitChanges() { +def commitChanges(isNmUpdate, isCommunityUpdate) { + String updatedLayers = "" + if(isNmUpdate) { updatedLayers += "netmoudle"} + if(isNmUpdate && isCommunityUpdate) { updatedLayers += " and " } + if(isCommunityUpdate) { updatedLayers += "community" } sh(script: "git add -u") - sh(script: "git commit -m \"submodules: updated ${updatedPart} hashes\" && git push") + sh(script: "git commit -m \"submodules: updated ${updatedLayers} hashes\" && git push") } \ No newline at end of file