Jenkins Job(在Windows环境中)无法访问共享位置 [英] Jenkins Job (In Windows environment) not able to access Shared locations

查看:128
本文介绍了Jenkins Job(在Windows环境中)无法访问共享位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Jenkins(Windows环境)中为Windows EXE程序(通过.NET实现)进行批处理.

I am trying to schedule a batch in Jenkins (Windows environment) for Windows EXE program (Implemented through .NET).

此程序引用网络中的某些共享位置(即\ shared network.net \ sample路径),以便读取和写入文件.

This program refers to some shared location in the network (viz. \shared network.net\sample path) for the sake of reading from and writing into files.

当我独立于Jenkins运行该程序时,它可以正常工作,因为它会将我的登录视为实际可以通过共享路径访问的用户.

When I run this program independently out of Jenkins, it works fine, as it considers my login as user who actually has access over shared path.

但是,当我通过Jenkins运行它时,访问存在问题.通过我的程序日志,我检查并发现它使用"NT AUTHORITY \ SYSTEM"作为用户.

However, when I run it through Jenkins, there is issue over access. Through my program logs I checked and found that it uses 'NT AUTHORITY\SYSTEM' as user.

我需要使Jenkins作业通过特定用户的身份验证运行,该身份验证将通过共享路径进行相关访问.

I need to make Jenkins job run through particular user's authentication, which will have relevant access over shared path.

请告知.

推荐答案

几个选项:

  1. 使用"net use"使用您的凭据在作业会话下映射网络位置.
  2. 在Windows从属服务器中,您可以转到services-> Jenkins slave-> properties.在登录"部分下,您可以指定要在其下运行服务的用户.

我肯定会选择第一个选项,因为它更易于管理(明天您将替换您的从属,并且必须重新做一遍,而不仅仅是迁移作业并再次映射会话).

I would definitely go with the first option as it is much more manageable (tomorrow you'll replace your slave and have to do it all over again, instead of just migrating the job and mapping the session again).

祝你好运!

这篇关于Jenkins Job(在Windows环境中)无法访问共享位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆