詹金斯复制目录/文件在构建 [英] Jenkins copy directories/files in a build

查看:100
本文介绍了詹金斯复制目录/文件在构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图构建过程中的文件复制到网络目录,我不断收到一个没有这样的文件或目录错误消息。

I am trying to copy files out to a network directory during a build, and I keep getting a " No such file or directory" error message.

复制到本地驱动器正常工作:
CP -Rf C:/詹金斯/部署/ TW_ISSUE_A / src目录C:/詹金斯/部署/ TW_ISSUE_A /目标

Copying to local drive works fine: cp -Rf c:/Jenkins/deployments/TW_ISSUE_A/src c:/Jenkins/deployments/TW_ISSUE_A/target

下面都会抛出了同样的信息:

The following all throw the same message:


  • CP -Rf C:/詹金斯/部署/ TW_ISSUE_A / src目录H:/ some_dir

  • cp -Rf c:/Jenkins/deployments/TW_ISSUE_A/src H:/some_dir

CP -Rf C:/詹金斯/部署/ TW_ISSUE_A / src目录H:\\ some_dir

cp -Rf c:/Jenkins/deployments/TW_ISSUE_A/src H:\some_dir

CP -Rf C:/詹金斯/部署/ TW_ISSUE_A / src目录//哈贝尔/ MISGenl / some_dir

cp -Rf c:/Jenkins/deployments/TW_ISSUE_A/src //Hubbell/MISGenl/some_dir

CD C:/詹金斯/部署/ TW_ISSUE_A / src目录
 rsync的-avuzb //哈贝尔/ MISGenl /项目/ Tronweb / TronwebBuilds /测试/ ORA / SQL /

cd c:/Jenkins/deployments/TW_ISSUE_A/src rsync -avuzb //Hubbell/MISGenl/Projects/Tronweb/TronwebBuilds/test/ora/sql/

CP -Rf C:/詹金斯/部署/ TW_ISSUE_A / src目录/ cygdrive / H / some_dir

cp -Rf c:/Jenkins/deployments/TW_ISSUE_A/src /cygdrive/h/some_dir

我甚至创造了一个shell脚本,从詹金斯打电话,但我不断收到该消息。

I've even created a shell script to call from Jenkins, but I continue to receive that message.

#!/bin/bash

url="http://as-test02:8080/job/TW_ISSUE_A_BUILD/lastSuccessfulBuild/artifact/bui
ld-TW_ISSUE_A_BUILD.tar";

remote_stage_dir="/cygdrive/h/some_dir"

#fetch the artifacts

(cd "$remote_stage_dir" && wget "$url" && tar xvf build-TW_ISSUE_A_BUILD.tar dat
 java ora && rm -rf *.tar && cp -r ./ora/* ../INTEGRATION)

有没有办法出来的文件复制到映射驱动器构建机器上?

Is there any way to copy files out to a mapped drive on the build machine?

感谢您!!

推荐答案

我猜映射驱动器不可用在服务范围内,或执行詹金斯没有访问它的用户。哪些用户正在运行詹金斯作为?

I would guess the mapped drive isn't available in the services context, or that the user executing Jenkins doesn't have access to it. What user is Jenkins running as?

编辑:
我认为你的问题有两个方面:

I think your problem has two aspects:


  1. 运行詹金斯服务的用户不允许连接到网络。

  2. H:不知道用户

  1. The user running the Jenkins service isn't allowed to connect to the network.
  2. h: isn't known to the user.

如果您没有修改它,服务是最有可能的 LocalSystem帐户。您可以通过运行该修改 SERVICES.MSC (或导航到通过Windows控制面板服务),并定位詹金斯服务。这应该解决的首要问题。

If you haven't modified it, the service is most likely running under the LocalSystem account. You can modify this by running services.msc (or navigate to services via the Windows control panel) and locating the jenkins service. This should resolve the first problem.

的第二个问题可以通过使用 UNC 的路径被解析(如你试过以上),而不是网络驱动器。

The second problem can be resolved by using UNC paths (as you tried above) instead of network drives.

借助詹金斯维基大约有这样的问题的文章:<一href=\"https://wiki.jenkins-ci.org/display/JENKINS/My+software+builds+on+my+computer+but+not+on+Jenkins\"相对=nofollow>我的软件构建我的电脑上,但不能在詹金斯

The Jenkins wiki has an article about problems like this: My software builds on my computer but not on Jenkins

这篇关于詹金斯复制目录/文件在构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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