1
votes

I have installed instance of Jenkins on Windows and I use Workflow plugin to configure build steps of job.

Now I'am trying to get list of tags available in my branch. It seems that the only way to do that is to call batch command(I've omitted specific options)

node('master') {

    stage concurrency: 1, name: 'Test & Build'

    git branch: branchName, credentialsId: bitbucketCredentialsId, url: repositoryUrl

    bat 'call git.exe tag'
    // bat 'git tag'

}

But when I build the job I always get the following error:

'git.exe' is not recognized as an internal or external command, 
operable program or batch file.

Jenkins is configured to work with GIT. System PATH variable contains path to git binary. Running above command by using cmd directly in workspace folder gives successful result.

Could someone please suggest another points which I should check?

2
Do you have a Git default installation in the global settings?Bruno Lavit
Yes, sure. I have a few free-style jobs which are use "Source Code Management -> Git Repository" and work successfully.GPanda

2 Answers

2
votes

Thanks to all who have tried to help.

I found the issue.

I've forgot to reboot my machine after system PATH variable update.

0
votes

Can you try this solution? (Setting Up section)

https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md

Delete your Git installation and add Jgit?

enter image description here