Re: Git Plugin not pulling from repo when builds are initiated

2014-09-11 Thread Eugene Sajine
in our case we are using relative path to the repo under the same user who 
runs Jenkins (if jenkins is setup under folder ~/jenkins, and repos are in 
let's say ~/repos/my_project, then custom workspace would be 
"../repos/my_project"). It seems to work well with multiple slaves - we 
have more than a 1000 jobs configured that way.

On Thursday, September 11, 2014 12:37:58 PM UTC-4, Mark Waite wrote:
>
> If you really must use a workspace other than the default, then Eugene is 
> correct, you'll need to use the advanced setting.
>
> If you choose that path, you should be aware that you've chosen a path 
> which doesn't work well with multiple slave agents.
>
> If you're using a custom workspace due to a large repository, you could 
> try using a reference repository instead.
>
> Mark Waite
>
> On Thu, Sep 11, 2014 at 10:24 AM, Eugene Sajine  > wrote:
>
>> I could recommend to use the custom workspace for your job (it is in 
>> advanced settings for the job). Set it to where your local git repository 
>> is and it will all work.
>>
>>
>> On Thursday, September 11, 2014 12:04:20 PM UTC-4, polarice wrote:
>>>
>>> Hello Mark,
>>>
>>> After looking at your third suggestion, we realized that the fetch and 
>>> checkout is occurring in the job's *workspace* instead of the directory 
>>> where the repo is stored. Is it possible to change the directory where the 
>>> git plugin works prior to fetching? I tried adding a shell command to 
>>> switch directories to where the repo is stored as one of the build steps 
>>> (right before the ant build) but that shell command is executed *after  
>>> *git has already checked out in the workspace of the job. Can I add 
>>> arbitrary commands before the plugin starts executing?
>>>
>>> On Wednesday, September 10, 2014 4:43:04 PM UTC-4, polarice wrote:

 I have the git plugin installed and configured for one of my jobs. When 
 I build the job, I expect it to pull the latest changes for the branch I 
 specify and *then* continue with the rest of the build process (e.g., 
 unit tests, etc.). 

 When I look at the console output, I 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  (origin/some_branch)
  > git config core.sparsecheckout
  > git checkout -f 
  > git rev-list 


 I see that the plugin fetches and checks out the proper commit hash, but 
 when the tests run it seems as though the repo wasn't updated at all.
 If I go into the repository in Jenkins, I see there that the latest 
 changes were never pulled. Why is this plugin behaving this way? 

 *Shouldn't it pull before it tries to build?* 

 I have git 1.8.5 installed on my Jenkins machine, which is a recommended 
 version.
 https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin

  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Thanks!
> Mark Waite
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git Plugin not pulling from repo when builds are initiated

2014-09-11 Thread Mark Waite
If you really must use a workspace other than the default, then Eugene is
correct, you'll need to use the advanced setting.

If you choose that path, you should be aware that you've chosen a path
which doesn't work well with multiple slave agents.

If you're using a custom workspace due to a large repository, you could try
using a reference repository instead.

Mark Waite

On Thu, Sep 11, 2014 at 10:24 AM, Eugene Sajine  wrote:

> I could recommend to use the custom workspace for your job (it is in
> advanced settings for the job). Set it to where your local git repository
> is and it will all work.
>
>
> On Thursday, September 11, 2014 12:04:20 PM UTC-4, polarice wrote:
>>
>> Hello Mark,
>>
>> After looking at your third suggestion, we realized that the fetch and
>> checkout is occurring in the job's *workspace* instead of the directory
>> where the repo is stored. Is it possible to change the directory where the
>> git plugin works prior to fetching? I tried adding a shell command to
>> switch directories to where the repo is stored as one of the build steps
>> (right before the ant build) but that shell command is executed *after  *git
>> has already checked out in the workspace of the job. Can I add arbitrary
>> commands before the plugin starts executing?
>>
>> On Wednesday, September 10, 2014 4:43:04 PM UTC-4, polarice wrote:
>>>
>>> I have the git plugin installed and configured for one of my jobs. When
>>> I build the job, I expect it to pull the latest changes for the branch I
>>> specify and *then* continue with the rest of the build process (e.g.,
>>> unit tests, etc.).
>>>
>>> When I look at the console output, I 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  (origin/some_branch)
>>>  > git config core.sparsecheckout
>>>  > git checkout -f 
>>>  > git rev-list 
>>>
>>>
>>> I see that the plugin fetches and checks out the proper commit hash, but 
>>> when the tests run it seems as though the repo wasn't updated at all.
>>> If I go into the repository in Jenkins, I see there that the latest changes 
>>> were never pulled. Why is this plugin behaving this way?
>>>
>>> *Shouldn't it pull before it tries to build?*
>>>
>>> I have git 1.8.5 installed on my Jenkins machine, which is a recommended 
>>> version.
>>> https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin
>>>
>>>  --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks!
Mark Waite

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git Plugin not pulling from repo when builds are initiated

2014-09-11 Thread Eugene Sajine
I could recommend to use the custom workspace for your job (it is in 
advanced settings for the job). Set it to where your local git repository 
is and it will all work.

On Thursday, September 11, 2014 12:04:20 PM UTC-4, polarice wrote:
>
> Hello Mark,
>
> After looking at your third suggestion, we realized that the fetch and 
> checkout is occurring in the job's *workspace* instead of the directory 
> where the repo is stored. Is it possible to change the directory where the 
> git plugin works prior to fetching? I tried adding a shell command to 
> switch directories to where the repo is stored as one of the build steps 
> (right before the ant build) but that shell command is executed *after  *git 
> has already checked out in the workspace of the job. Can I add arbitrary 
> commands before the plugin starts executing?
>
> On Wednesday, September 10, 2014 4:43:04 PM UTC-4, polarice wrote:
>>
>> I have the git plugin installed and configured for one of my jobs. When I 
>> build the job, I expect it to pull the latest changes for the branch I 
>> specify and *then* continue with the rest of the build process (e.g., 
>> unit tests, etc.). 
>>
>> When I look at the console output, I 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  (origin/some_branch)
>>  > git config core.sparsecheckout
>>  > git checkout -f 
>>  > git rev-list 
>>
>>
>> I see that the plugin fetches and checks out the proper commit hash, but 
>> when the tests run it seems as though the repo wasn't updated at all.
>> If I go into the repository in Jenkins, I see there that the latest changes 
>> were never pulled. Why is this plugin behaving this way? 
>>
>> *Shouldn't it pull before it tries to build?* 
>>
>> I have git 1.8.5 installed on my Jenkins machine, which is a recommended 
>> version.
>> https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git Plugin not pulling from repo when builds are initiated

2014-09-11 Thread polarice
Hello Mark,

After looking at your third suggestion, we realized that the fetch and 
checkout is occurring in the job's *workspace* instead of the directory 
where the repo is stored. Is it possible to change the directory where the 
git plugin works prior to fetching? I tried adding a shell command to 
switch directories to where the repo is stored as one of the build steps 
(right before the ant build) but that shell command is executed *after  *git 
has already checked out in the workspace of the job. Can I add arbitrary 
commands before the plugin starts executing?

On Wednesday, September 10, 2014 4:43:04 PM UTC-4, polarice wrote:
>
> I have the git plugin installed and configured for one of my jobs. When I 
> build the job, I expect it to pull the latest changes for the branch I 
> specify and *then* continue with the rest of the build process (e.g., 
> unit tests, etc.). 
>
> When I look at the console output, I 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  (origin/some_branch)
>  > git config core.sparsecheckout
>  > git checkout -f 
>  > git rev-list 
>
>
> I see that the plugin fetches and checks out the proper commit hash, but when 
> the tests run it seems as though the repo wasn't updated at all.
> If I go into the repository in Jenkins, I see there that the latest changes 
> were never pulled. Why is this plugin behaving this way? 
>
> *Shouldn't it pull before it tries to build?* 
>
> I have git 1.8.5 installed on my Jenkins machine, which is a recommended 
> version.
> https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Git Plugin not pulling from repo when builds are initiated

2014-09-11 Thread Mark Waite
I don't think the plugin is the problem in your case.  If it is, you've
found a glaring failure in a widely used plugin.  It is possible, but seems
unlikely.

The log entries you listed seem to confirm that the plugin performs the
fetch and the checkout of the latest SHA-1.  That is the functional
equivalent of a "git pull".  I suspect there is something else wrong in
your job configuration.

You might try inserting a first build step "git log -n 1" to report the
most recent checkout in the working directory before your actual build
steps begin.

You might try inserting a final build step "git log -n 1" to report the
checkout in the working directory after your build completes.

You might double check that your build script is building from the working
directory, not from some other directory.

You might also describe the platform where you're running the job, any
non-default settings you've used for the git plugin configuration of that
job, and if you are using other plugins which may interact with the git
plugin (like one of the Gerrit plugins).

Thanks,
Mark Waite

On Wed, Sep 10, 2014 at 2:43 PM, polarice  wrote:

> I have the git plugin installed and configured for one of my jobs. When I
> build the job, I expect it to pull the latest changes for the branch I
> specify and *then* continue with the rest of the build process (e.g.,
> unit tests, etc.).
>
> When I look at the console output, I 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  (origin/some_branch)
>  > git config core.sparsecheckout
>  > git checkout -f 
>  > git rev-list 
>
>
> I see that the plugin fetches and checks out the proper commit hash, but when 
> the tests run it seems as though the repo wasn't updated at all.
> If I go into the repository in Jenkins, I see there that the latest changes 
> were never pulled. Why is this plugin behaving this way?
>
> *Shouldn't it pull before it tries to build?*
>
> I have git 1.8.5 installed on my Jenkins machine, which is a recommended 
> version.
> https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks!
Mark Waite

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.