GPanda
GPanda

Reputation: 41

Jenkins Workflow. Can't execute batch script with git command

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?

Upvotes: 1

Views: 2635

Answers (2)

GPanda
GPanda

Reputation: 41

Thanks to all who have tried to help.

I found the issue.

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

Upvotes: 3

Bruno Lavit
Bruno Lavit

Reputation: 10382

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

Upvotes: 0

Related Questions