Jenkins 使用 SSH 插件发布传输 0 个文件 [英] Jenkins transferring 0 files using publish over SSH plugin

查看:21
本文介绍了Jenkins 使用 SSH 插件发布传输 0 个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将文件从构建后的 Jenkins 工作区传输到远程服务器上的某个位置.构建工作的所有步骤都很顺利,但总是传输 0 个文件.

I want to transfer files from my post build Jenkins workspace to a location on a remote server. Build goes smoothly for all steps in the job but always transfers 0 files.

这是控制台输出:

    Started by user Patrick
    Building in workspace /var/lib/jenkins/jobs/20eyes Build/workspace
    Fetching changes from the remote Git repository
    Fetching upstream changes from https://github.com/project/project.git
    using .gitcredentials to set credentials
    Checking out Revision a758e0f8e534271b999a2fc8696b6fd5a3d5e500 (origin/master)
    executing script:

    cd /var/www/20eyes-web
    [SSH] exit-status: 0
    SSH: Connecting from host [dev1.remotehost]
    SSH: Connecting with configuration [dev2.remotehost] ...
    SSH: Disconnecting configuration [dev2.remotehost] ...
    SSH: Transferred 0 file(s)
    Build step 'Send files or execute commands over SSH' changed build result to  SUCCESS
    Finished: SUCCESS

作业被配置为在任何提交被推送到 GitHub 后构建

The job is configured to build after any commit is pushed to GitHub

转移集是:源文件:

/var/lib/jenkins/jobs/20eyes Build/workspace/**/*

删除前缀:

/var/lib/jenkins/jobs/20eyes Build/workspace

推荐答案

我想,你的配置有问题.我们有 2 个位置要配置.

I thinks, problem at your config. We have 2 positions to configure.

  1. 在系统配置(全局配置).--> 如果测试正常 ==> 远程服务器配置正常.
  2. 在你的项目中.我们将重点关注传输集:(源文件,删除前缀,远程目录)

  1. At System configuration (Global config). --> If test ok ==> Configuration to remote server is ok.
  2. At your project. We will focus about transfer set: (Source file, Remove prefix, remote directory)

2.1 源文件:如果它是空白 = 工作区目录.在你的情况下,我认为你应该输入 **/*
2.2 删除前缀:参考这里了解更多信息.
2.3 远程目录:如果为空=上面系统配置中配置的目录.

2.1 Source file : if it's blank = workspace directory. in your case i think you should input **/*
2.2 Remove prefix : refer Here for more info.
2.3 Remote directory: if it's blank = directory that is configured at System configuration above.

希望对您有所帮助!对不起我的英语.

Hope it help! Sorry about my English.

这篇关于Jenkins 使用 SSH 插件发布传输 0 个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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