use CHANGE_TARGET to rebase on actual PR target

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2019-05-15 17:43:09 +02:00
parent c90fe74d9f
commit 4f4cc91b88
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 6 additions and 2 deletions

View File

@ -51,10 +51,14 @@ def doGitRebase() {
println 'Skipping rebase due to release build...'
return
}
def rebaseBranch = 'develop'
if (CHANGE_TARGET) { /* This is available for PR builds */
rebaseBranch = CHANGE_TARGET
}
sh 'git status'
sh 'git fetch --force origin develop:develop'
sh "git fetch --force origin ${rebaseBranch}:${rebaseBranch}"
try {
sh 'git rebase develop'
sh "git rebase ${rebaseBranch}"
} catch (e) {
sh 'git rebase --abort'
throw e