Jenkins Git Plugin not pulling latest changes before building job -
i working jenkins ci , trying configure jobs use git.
i have git plugin installed , configured 1 of jobs. when build job, expect pull latest changes branch specify , continue rest of build process (e.g., unit tests, etc.).
when @ console output, see
> git fetch --tags --progress ssh://gerrit@git-dev/util +refs/heads/*:refs/remotes/origin/* > git rev-parse origin/some_branch^{commit} checking out revision <latest_sha1> (origin/some_branch) > git config core.sparsecheckout > git checkout -f <latest_sha1> > git rev-list <latest_sha1>
i see plugin fetches , checks out proper commit hash, when tests run seems though repo wasn't updated @ all. if go repository in jenkins, see there latest changes never pulled.
shouldn't pull before tries build?
i have git 1.8.5 installed on jenkins machine, recommended version. https://wiki.jenkins-ci.org/display/jenkins/git+plugin
after checking other similar sounding questions on so, answers weren't helpful problem.
i believe jenkins pulls changes , builds in it's own tmp directory. so, repository directory isn't getting updated although jenkins building new code in it's own sandbox.
my solution has been add "git pull" step in build process so:
when new commit delivered github repo:
1. build project
if successful, perform following post-build steps:
1. execute shell:
cd /your/repo/directory/ git pull
you can modify "git pull" command whatever need if 'pull' doesn't work you.
Comments
Post a Comment