update-src-revision: Overwrite nightly branch
This branch is reserved for that and may not be merged every day. We want to overwrite anyway everynight with the latest changes.
This commit is contained in:
parent
1ef66cc7c8
commit
5bd30a70f1
|
|
@ -91,18 +91,6 @@ def updateTheSourceRevisions(commonHelpers, repoDir, theBranch) {
|
|||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
def setupNewBranchAndGetGitPushPostfix(theNewBranch) {
|
||||
if(sh(returnStatus: true, script: "git checkout ${theNewBranch}") == 0) {
|
||||
println "----------------------------------------------------\n\
|
||||
NOTE: Branch ${theNewBranch} already available \n\
|
||||
and potentially as well a pull/merge request.\n\
|
||||
--> handle this branch and request first\n----------------------------------------------------"
|
||||
error("Available branch ${theNewBranch} detected --> handle this first")
|
||||
}
|
||||
|
||||
sh(script: "git checkout -b ${theNewBranch}")
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
def createPR(theBranch) {
|
||||
def prReviewer = "bard"
|
||||
def prProject = "NM-NSP"
|
||||
|
|
@ -151,7 +139,6 @@ def commitAndPushTheChanges(commonHelpers, repoDir, origBranch) {
|
|||
}
|
||||
else {
|
||||
def theCredentials = commonHelpers.getGitCredentialID()
|
||||
setupNewBranchAndGetGitPushPostfix("${nightlyBranch}")
|
||||
println "Commit and Push changes; message = '${commitMsg}'\nchanges = ${changedItems}"
|
||||
sshagent (credentials: [theCredentials]) {
|
||||
// ToDo: replace the user.email and user.name once a CI user is setup in the
|
||||
|
|
@ -159,8 +146,9 @@ def commitAndPushTheChanges(commonHelpers, repoDir, origBranch) {
|
|||
sh(label: "Commit and push changes", returnStdout: true, script: """
|
||||
git config --global user.email "marc.mattmueller@netmodule.com"
|
||||
git config --global user.name "Marc Mattm\u00fcller"
|
||||
git checkout -B ${nightlyBranch}
|
||||
git commit -m "${commitMsg}"
|
||||
git push -u origin ${nightlyBranch}
|
||||
git push --force --set-upstream origin ${nightlyBranch}
|
||||
""")
|
||||
}
|
||||
usedBranch = "${nightlyBranch}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue