I have been using Jenkins for many years, but I have never needed more than one agent for my tasks. Just recently, I found the need to add another agent, which is not Linux but Windows. Now, this node has everything ready; Git is installed as well. However, when I run the Jenkins jobs, it gives an error.
[Pipeline] checkout Selected Git installation does not exist. Using Default The recommended git tool is: NONE using credential bitbucket-creds
/usr/bin/git rev-parse --resolve-git-dir c:\jenkins\workspace\prod-init-qa-job.git # timeout=10 ERROR: Workspace has a .git repository, but it appears to be corrupt. hudson.plugins.git.GitException: Error performing git command: /usr/bin/git rev-parse --resolve-git-dir c:\jenkins\workspace\prod-init-qa-job.git at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2858) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2762) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2757)
The pipeline is very basic. look something like this
pipeline { agent { label 'win-agent1' } stages { stage('Execute QA Job') { steps { dir('ansible-code') { git branch: 'main', changelog: false, credentialsId: 'bitbucket-creds', poll: false, url: 'https://[email protected]/xys/ansible.git' } sh "ansible-playbook -i ansible-code/qa-ais-pipeline/inv.ini ansible-code/qa-ais-pipeline/init-qa-job.yaml" bat "python c:\\qa-code\\OldSmokeTest.py" } } } }