Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
jenkins: force fetch on each PR.
Browse files Browse the repository at this point in the history
If a PR was updated with a push force. We need to force
to update the brach to test this commit does:

- clean current branch.
- If testing a PR, force to fetch and pull a brach with latest changes.

Fixes: #894

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
  • Loading branch information
jcvenegas committed Feb 6, 2018
1 parent cf30d19 commit eaed2b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .ci/jenkins_job_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,17 @@ pr_number=

[ "${ghprbPullId}" ] && [ "${ghprbTargetBranch}" ] && pr_number="${ghprbPullId}"

# Make sure repo is clean
git clean -dfx

if [ -n "$pr_number" ]
then
pr_branch="PR_${pr_number}"

# Create a separate branch for the PR. This is required to allow
# checkcommits to be able to determine how the PR differs from
# "master".
git fetch origin "pull/${pr_number}/head:${pr_branch}"
git fetch --force origin "pull/${pr_number}/head:${pr_branch}"
git checkout "${pr_branch}"
git rebase "origin/${ghprbTargetBranch}"
else
Expand Down

0 comments on commit eaed2b3

Please sign in to comment.