Skip to content

Commit

Permalink
Merge pull request #1935 from brave/0.61.x_pr1927_fix-jenkins-file
Browse files Browse the repository at this point in the history
Remove rebase logic from PR builder (uplift to 0.61.x)
  • Loading branch information
bsclifton authored Mar 13, 2019
2 parents a0a6fbf + 8ddd76e commit 921ac0c
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pipeline {
fi
echo "Cloning brave-browser..."
git clone -b ${TARGET_BRANCH} ${BB_REPO} || git clone ${BB_REPO}
git clone --branch ${TARGET_BRANCH} ${BB_REPO} || git clone ${BB_REPO}
cd brave-browser
git config user.name brave-builds
Expand All @@ -37,30 +37,15 @@ pipeline {
if [ "`curl -s -w %{http_code} -o /dev/null ${BB_REPO}/tree/${BRANCH_TO_BUILD}`" = "404" ]; then
echo "Creating ${BRANCH_TO_BUILD} branch in brave-browser..."
git checkout -f -b ${BRANCH_TO_BUILD}
git checkout --force --branch ${BRANCH_TO_BUILD}
echo "Pinning brave-core to branch ${BRANCH_TO_BUILD}..."
jq "del(.config.projects[\\"brave-core\\"].branch) | .config.projects[\\"brave-core\\"].branch=\\"${BRANCH_TO_BUILD}\\"" package.json > package.json.new
mv package.json.new package.json
echo "Pushing changes..."
git commit -a -m "pin brave-core to branch ${BRANCH_TO_BUILD}"
git commit --all --message "pin brave-core to branch ${BRANCH_TO_BUILD}"
git push ${BB_REPO}
else
echo "Rebasing brave-browser branch against ${TARGET_BRANCH}..."
git checkout ${BRANCH_TO_BUILD}
set +e
git fetch -p
git rebase origin/${TARGET_BRANCH}
if [ \$? -ne 0 ]; then
echo "Failed to rebase (conflicts), will need to be manually rebased!"
git rebase --abort
else
echo "Rebased ${BRANCH_TO_BUILD} against ${TARGET_BRANCH}"
git push ${BB_REPO}
fi
set -e
fi
echo "Sleeping 5m so new branch is discovered or associated PR created in brave-browser..."
Expand Down

0 comments on commit 921ac0c

Please sign in to comment.