diff --git a/jobs/Jenkinsfile_Common b/jobs/Jenkinsfile_Common index 4279033..ed6eaac 100644 --- a/jobs/Jenkinsfile_Common +++ b/jobs/Jenkinsfile_Common @@ -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 diff --git a/jobs/Jenkinsfile_UpdateSrcRevisions b/jobs/Jenkinsfile_UpdateSrcRevisions index 380601e..00d4535 100644 --- a/jobs/Jenkinsfile_UpdateSrcRevisions +++ b/jobs/Jenkinsfile_UpdateSrcRevisions @@ -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) }