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