简体   繁体   English

Jenkins使用的登录凭据与登录用户的凭据不同

[英]Jenkins doesn't use the same credentials that the logged in user has

I'm running Jenkins on a Windows Server and want to have access to a mapped network drive. 我在Windows Server上运行Jenkins,并希望能够访问映射的网络驱动器。 I run the Jenkins using the same user credentials that I'm logged in with. 我使用登录时使用的相同用户凭据来运行Jenkins。 Here's the problem: I don't have the same access to the files on the mapped drive from Jenkins and my local command prompt. 问题出在这里:我对Jenkins和本地命令提示符下的映射驱动器上的文件没有相同的访问权限。 Here's what I get when I one to change the directory in Window Server CMD : 这是我在Window Server CMD更改目录时得到的:

C:\Users\DevBuildUser>cd /d r:
R:\>

and this is what happens in Jenkins' Execute Windows batch command running on the same machine: 这就是在同一台计算机上运行的Jenkins的Execute Windows batch command发生的情况:

cd /d r: 
The system cannot find the drive specified.

Jenkins will run that batch file as the SYSTEM user. Jenkins将以SYSTEM用户身份运行该批处理文件。 Go to the TARGET machine, and add the name of the machine from which you're running the Jenkins instance, with full write permissions. 转到TARGET机器,并添加具有完全写入权限的运行Jenkins实例的机器的名称。

...and use the full path, eg, \\10.1.2.3\\myshare\\mynewfiles\\ ...并使用完整路径,例如\\ 10.1.2.3 \\ myshare \\ mynewfiles \\

Alternatively: 或者:

whoami
net use R: \\server\share\dir
R:
mkdir zipme

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM