jobs/updateSrcRev,common: added artifact with branch to use
In the nightly job there might be changes about some source revisions and thus a new branch is created including a pull request. The created branch is written to a file and archived as artifact. This makes it possible to use this branch in a nightly build for building the targets. Signed-off-by: Marc Mattmüller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
d384814fb3
commit
c8b22f8cf5
|
|
@ -38,6 +38,14 @@ env.NEXUS_PROTOCOL = "https"
|
|||
env.NEXUS_REPOSITORY = "maven-releases"
|
||||
env.NEXUS_ARTIFACT_COPIER_URL = "${env.NEXUS_PROTOCOL}://${env.NEXUS_URL}/repository/${env.NEXUS_REPOSITORY}"
|
||||
|
||||
// General CI definitions
|
||||
//----------------------------
|
||||
env.TARGET_BUILD_JOB = "/nwl-target"
|
||||
env.SRCREV_UPDATE_JOB = "/nwl-update-src-rev"
|
||||
|
||||
env.NIGHTLY_BRANCH_FILE = "nwl-nightly-branch"
|
||||
|
||||
|
||||
|
||||
// Methods declared in external code are accessible
|
||||
// directly from other code in the external file
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ pipeline {
|
|||
steps {
|
||||
script {
|
||||
updateTheSourceRevisions(common, "${env.YOCTO_REPO_DIR}", "${params.BUILD_BRANCH}")
|
||||
commitAndPushTheChanges(common, "${env.YOCTO_REPO_DIR}")
|
||||
commitAndPushTheChanges(common, "${env.YOCTO_REPO_DIR}", "${params.BUILD_BRANCH}")
|
||||
}
|
||||
}
|
||||
post {
|
||||
|
|
@ -134,9 +134,11 @@ def createPR(theBranch) {
|
|||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
def commitAndPushTheChanges(commonHelpers, repoDir) {
|
||||
def commitAndPushTheChanges(commonHelpers, repoDir, origBranch) {
|
||||
def commitMsg = "srcrev: updated source revisions by Jenkins Job"
|
||||
def nightlyBranch = "nightly"
|
||||
def usedBranch = "${origBranch}"
|
||||
def branchFile = "./${env.NIGHTLY_BRANCH_FILE}"
|
||||
|
||||
dir(repoDir) {
|
||||
if(sh(returnStdout: true, script: "git status | grep \"modified:\" | wc -l").toInteger() != 0) {
|
||||
|
|
@ -162,7 +164,10 @@ def commitAndPushTheChanges(commonHelpers, repoDir) {
|
|||
""")
|
||||
}
|
||||
createPR("${nightlyBranch}")
|
||||
usedBranch = "${nightlyBranch}"
|
||||
}
|
||||
}
|
||||
} // if changes available
|
||||
}
|
||||
writeFile(file: branchFile, text: "${usedBranch}")
|
||||
archiveArtifacts(artifacts: branchFile, onlyIfSuccessful: true)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue