我正在尝试为我的maven项目使用Jenkins主从架构。我在Windows机器上有Jenkins master,在Linux机器上有slave。现在的问题是,当我运行我的Jenkins脚本时,它给我一个错误,就像无法初始化git存储库,因为Jenkins试图在Linux从机上执行git.exe。任何人都可以让我知道我该如何解决它?
以下是我的Jenkins管道脚本和错误日志
node ('lx-dotoolsd1')
{
stage 'Checkout'
git branch: 'master', credentialsId: 'ee44e971-4cce-4e59-95b6-
da222007775b', url: ' http://o-heena@bitbucket:7990/scm/phoen/audit-
confirmation.git'
stage 'Test'
def pom = readMavenPom file: 'pom.xml'
print "Build: " + pom.version
env.POM_VERSION = pom.version
//batch 'mvn clean compile install'
//junit '**/target/surefire-reports/TEST-*.xml'
currentBuild.description = "v${pom.version} (${env.branch})"
}
错误如下
Started by user Patel,Heena
[Pipeline] node
Running on lx-dotoolsd1 in /var/jenkins/workspace/pipelineTest
[Pipeline] {
[Pipeline] stage (Checkout)
Entering stage Checkout
Proceeding
[Pipeline] git
Cloning the remote Git repository
Cloning repository http://o-heena@bitbucket:7990/scm/phoen/audit-confirmation.git
> git.exe init /var/jenkins/workspace/pipelineTest # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init /var/jenkins/workspace/pipelineTest
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:656)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:463)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
at hudson.remoting.UserRequest.perform(UserRequest.java:152)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:332)