0

I am trying to set up Jenkins runnning on windows connected to gitlab. Git will checkout a jenkinsfile that it will run on a Linux slave. Pipeline code is basic echo commands. I do not want to manually keep putting pipeline code inside my jobs.

  • SSH keys have been generated via gitbash and synched with git. Pull works on gitbash.
  • Git path has been added in global env variables of Jenkins.
  • I already ran git confit ssl verify off
  • Checkout is working

The pipeline is showing the below.. what am I missing on my Jenkins env on windows ? ———-

[Pipeline] checkout Selected Git installation does not exist. Using Default The recommended git tool is: NONE using credential c36c23b2-ea6e-4bc6-afff-dfbe559198e4 Cloning the remote Git repository Cloning with configured refspecs honoured and without tags ERROR: Error cloning remote repo 'origin'

———— hudson.plugins.git.GitException: Could not init /root/jenkins/workspace/CICD_2104

Abhishek B
  • 1
  • 1
  • 3
  • Jenkins over windows throws unexpected errors. Is it mandatory windows? Are the technologies to be built: c# or something that windows is required? – JRichardsz Apr 16 '21 at 14:23
  • I suspect some env issue in my Linux slave ?[Pipeline] checkout Selected Git installation does not exist. Using Default The recommended git tool is: NONE using credential c36c23b2-ea6e-4bc6-afff-dfbe559198e4 Cloning the remote Git repository Cloning with configured refspecs honoured and without tags ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Could not init /root/jenkins/workspace/CICD_2104 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.exe – Abhishek B Apr 16 '21 at 14:25

1 Answers1

0

If you already have Global Credential valid for your repository then, its only be keen on path of .jenkinsfile/.groovy you are providing in your pipeline.

Problem could be in 1.

Manage Jenkins --> Global Tool Configuration settings.

This answer will also help to guide with Global Tool Configuration setting.

Or 2. May be in your pipeline --> Script path is wrong.

If your repository is gitlab.domain.com:userid/playground.git

then root folder for Script path must playground and script path can be sub folder of playground.

e.g. My Jenkins file is structured like playground/Sample/ParallelPipeline.Jenkinsfile.

In this case script path will be Sample/ParallelPipeline.Jenkinsfile

enter image description here

Here is a LINK for complete process of configuring Jenkinsfile with Gitlab

np2807
  • 1,050
  • 15
  • 30
  • Ok. So I have one branch 2104. I juts updated my Jenkins file to run in master node and added a bat instead of sh.. it worked good on windows as long as I specified to build master in my pipeline. Maine issue is when I try running the build for branch 2104 that will run it on my Linux slave nodes. That is where it fails ? .. would I need to configure git connectivity on Linux slave too ? Pipeline code for 2104 has sh ‘’ – Abhishek B Apr 16 '21 at 14:58
  • That looks another problem no need to configure git connectivity on Linux slave, usually it should not matter if you run on Branch or Master, But you can defined agent / node label as your windows machine, in this way pipeline will be executed on windows instead of Linux, hope this helps. – np2807 Apr 19 '21 at 05:41