jenkinsfile_update2head: added info about updated layers to commit msg
BugzID: 73574 Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
e9ee8240e3
commit
d34fa204e1
|
|
@ -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")
|
||||
}
|
||||
Loading…
Reference in New Issue