jobs/updateSrcRev: added cloning of the repository (was missing)
Signed-off-by: Marc Mattmüller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
3ff3dc9435
commit
c4d49cdc0e
|
|
@ -32,6 +32,7 @@ pipeline {
|
|||
common = load "./jobs/Jenkinsfile_Common"
|
||||
|
||||
handleCleanBuild(common)
|
||||
common.gitCheckout("${env.YOCTO_REPO_URL}", "${params.BUILD_BRANCH}", "${env.YOCTO_REPO_DIR}", true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -39,14 +40,14 @@ pipeline {
|
|||
stage('Update') {
|
||||
steps {
|
||||
script {
|
||||
updateTheSourceRevisions(common, "${params.BUILD_BRANCH}")
|
||||
commitAndPushTheChanges(common)
|
||||
updateTheSourceRevisions(common, "${env.YOCTO_REPO_DIR}", "${params.BUILD_BRANCH}")
|
||||
commitAndPushTheChanges(common, "${env.YOCTO_REPO_DIR}")
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
common.cleanupRepository("./")
|
||||
common.cleanupRepository("${env.YOCTO_REPO_DIR}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -83,14 +84,17 @@ def handleCleanBuild(commonHelpers) {
|
|||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
def updateTheSourceRevisions(commonHelpers, theBranch) {
|
||||
def updateTheSourceRevisions(commonHelpers, repoDir, theBranch) {
|
||||
dir(repoDir) {
|
||||
commonHelpers.gitUpdateSubmodulesCheckoutBranch(theBranch, true, true)
|
||||
commonHelpers.printSubmoduleStatus(true)
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
def commitAndPushTheChanges(commonHelpers) {
|
||||
def commitAndPushTheChanges(commonHelpers, repoDir) {
|
||||
def commitMsg = "srcrev: updated source revisions by Jenkins Job"
|
||||
|
||||
dir(repoDir) {
|
||||
if(sh(returnStdout: true, script: "git status | grep \"modified:\" | grep -v coreos | wc -l").toInteger() != 0) {
|
||||
def itemFindCmd = "git status | grep \"modified:\" | grep -v coreos | cut -d':' -f2 | sed -e 's/^[ ]*//' | cut -d' ' -f1"
|
||||
def changedItems = sh(returnStdout: true, script: "${itemFindCmd}")
|
||||
|
|
@ -116,3 +120,4 @@ def commitAndPushTheChanges(commonHelpers) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue