I have not configured Git on Windows with Jenkins as a service. The jobs I run need to interact with the desktop and I prefer that they interact with the desktop by running on the desktop directly, rather than by running from a service which has been marked as being allowed to interact with the desktop.
Are you sure it is worth the hassle to run as a service? I've not yet found a case where I preferred running as a service on Windows above running with a logged in user. I didn't want to fight with the differences between a login session and a service so have always configured Windows to automatically login as a specific user, then I place the Jenkins startup commands in the Startup folder. Mark Waite >________________________________ > From: Andrew Gray <[email protected]> >To: [email protected] >Sent: Friday, February 17, 2012 5:24 PM >Subject: "Git On Windows with Jenkins" just doesn't work > > >Hi All, > >Git plugin frustrating... > >Environment: Windows 2003 SP2 >Jenkins 1.451 (running as a service under an administrative user, not a system >account...i.e me) > >- Public key successfully uploaded to bitbucket >- Public and private key copied to directories: >1. C:\documents and settings\<admin user>\.ssh ; and >2. C:\Program Files\Git\.ssh > >- Trying to follow instructions here: >https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin > >- Private key loaded into Pageant too. > >- When private key loaded into Pageant I CAN successfully run git clone >[email protected]:apgray/repository.git > >- Running ssh -T [email protected] produces the following output: >The authenticity of host 'bitbucket.org (207.223.240.181)' can't be >established. >RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40. >Are you sure you want to continue connecting (yes/no)? yes >Warning: Permanently added 'bitbucket.org,207.223.240.181' (RSA) to the list >of known hosts. >Permission denied (publickey). > >- known_hosts file is created which I copy to both the above directories so it >is sitting with the public and private key. > >- GIT_SSH and Path environment variable are set as directed > >- Running plink bitbucket.org asks: >login as: > >If I hit CTRL-C plink just exits and returns to the prompt >If I enter apgray and hit Enter I get: >FATAL ERROR: Disconnected: No supported authentication methods available >(server sent: publickey) > >The above steps do not appear to have worked properly > >If I plow on in the vain hope that something worked and set up Jenkins to >checkout from bitbucket.... > >Repository URL: [email protected]:apgray/repository.git >Name: leave blank >Refspec: leave blank >Branch Specifier: origin/master > >If I attempt a build this is what I get: > >Started by user Andrew Gray Building on master in workspace >D:\JenkinsHome\jobs\repository\workspace Checkout:workspace / D:\JenkinsHome\jobs\repository\workspace - hudson.remoting.LocalChannel@188665b Using strategy: Default Checkout:workspace / D:\JenkinsHome\jobs\repository\workspace - hudson.remoting.LocalChannel@188665b Cloning the remote Git repository Cloning repository origin ERROR: Error cloning remote repo 'origin' : Could not clone https://[email protected]/apgray/repository.git hudson.plugins.git.GitException: Could not clone https://[email protected]/apgray/repository.git at hudson.plugins.git.GitAPI.clone(GitAPI.java:245) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1029) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:970) at hudson.FilePath.act(FilePath.java:788) at hudson.FilePath.act(FilePath.java:770) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:970) at hudson.model.AbstractProject.checkout(AbstractProject.java:1195) at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:576) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:465) at hudson.model.Run.run(Run.java:1409) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:238) Caused by: hudson.plugins.git.GitException: Error performing command: C:\Program Files\Git\bin\git.exe clone --progress -o origin https://[email protected]/apgray/repository.git D:\JenkinsHome\jobs\respository\workspace null at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:776) at hudson.plugins.git.GitAPI.access$000(GitAPI.java:38) at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:241) at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:221) at hudson.FilePath.act(FilePath.java:788) at hudson.FilePath.act(FilePath.java:770) at hudson.plugins.git.GitAPI.clone(GitAPI.java:221) ... 12 more Caused by: java.lang.InterruptedException at java.lang.ProcessImpl.waitFor(Native Method) at hudson.Proc$LocalProc.join(Proc.java:319) at hudson.Launcher$ProcStarter.join(Launcher.java:345) at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:765) ... 18 more Trying next repository ERROR: Could not clone repository FATAL: Could not clone hudson.plugins.git.GitException: Could not clone at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1041) at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:970) at hudson.FilePath.act(FilePath.java:788) at hudson.FilePath.act(FilePath.java:770) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:970) at hudson.model.AbstractProject.checkout(AbstractProject.java:1195) at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:576) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:465) at hudson.model.Run.run(Run.java:1409) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:238) >WT? > >What am I missing? Has anyone got Jenkins running on windows as a service to >checkout from a remote git repository? > >It appears the instructions on the Git Plugin WIKI are either incomplete or >incorrect. > >Regards, > >Andrew > > >
