我的 github 存储库中的 Jenkins 文件用于 Jenkins Master/Slave 环境。我需要在远程 Jenkins 从服务器上执行测试命令。在我的声明式管道中,代理的调用方式如下:
stage("Testautomation") {
agent { label 'test-device' }
steps {
bat '''
@ECHO ON
ECHO %WORKSPACE%
... '''
}
}
Run Code Online (Sandbox Code Playgroud)
在 Jenkins 执行远程命令之前,它会开始从版本控制中签出。Jenkins Master 上的结帐没有问题并且工作正常。但在这个 Jenkins Slave 上我总是收到此错误消息。
using credential github-enterprise:...
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://...git # timeout=10
Fetching upstream changes from https://...git
> git --version # timeout=10
using GIT_ASKPASS to set credentials GitHub Enterprise Access Token
> …Run Code Online (Sandbox Code Playgroud)