Hi,
I have a pipeline with the checkout step as below… It’s failing with the very clear error that the remote git is local repository. Our git is setup in that way we have access only through the server to that repository (/git-repo/merp.git). So how to bypass my below error. I want the checkout step to work for the local repository. I have ran the below command in the script console in the jenkins UI. But still i’m getting the error.
Command ran in the script console:
System.setProperty(“hudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT”, “true”)
println(System.getProperty(“hudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT”))
The result i got is true. But still getting the same error
Error Message:
ERROR: Checkout of Git remote ‘/git-repo/merp.git’ aborted because it references a local directory, which may be insecure. You can allow local checkouts anyway by setting the system property ‘hudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT’ to true.
Finished: FAILURE
Here is my checkout step:
checkout changelog: true, poll: true, scm: [class: 'GitSCM', branches: [[name: "origin/{params.branch}"]],
doGenerateSubmoduleConfigurations: false, extensions: [[$class: ‘ChangelogToBranch’,
options: [compareRemote: ‘origin’, compareTarget: ‘qa’]]], submoduleCfg: , userRemoteConfigs: [[credentialsId: ‘**************’, url: ‘/git-repo/merp.git’]]]
I have seen some suggestions to add the above property in the /etc/sysconfig/jenkins file. but i don’t see any jenkins file under the “/etc/sysconfig” directory.
Note: I installed jenkins using the yum package and my version of jenkins is 2.426.1
Please let me know if anyone faced this issue and what are the steps you followed to resolve it.
Thanks,
Prudhvi M.