10

The scenario is - I have a job A which runs my ant script and packages the artifact's for me.

I am also using parametrized Triggered plug in to Trigger my "Job B" which will deploy my artifact on remote machine.

The job A is working fine and also Job B.

The tasks that i have to perform with Job B are

  1. GIT checkout (which contains my deployment scripts) (successfully doning).
  2. Copying artifacts from previous build to Remote machine. (successfully doing)
  3. Run shell script on remote machine(script present in workspace folder )- Facing issues.

I browsed various plug ins for the same but no one is allowing me to run shell script after , "SCP to remote machine" which is present in Post build action.

I would like to execute the same sequence, however if you guys have any other suggestions please share.

Thanks in Advance.!

4

3 回答 3

16

作为Publish Over SSH插件的一部分,您可以在复制文件后执行脚本。

  • 构建后操作下
  • 添加通过 SSH 发送构建工件
  • 选择一个预配置的服务器(在全局配置中完成)
  • 选择要从工作区复制的文件
  • 输入执行命令
    1. 如果您复制的文件之一是您的 shell 脚本,您可以在此处将其作为“执行命令”输入
于 2014-12-01T14:38:23.027 回答
4

为了解决我的查询,我使用了 Jenkins SSH 插件。这提供了一个配置选项卡,我可以在其中添加多个主机,然后在我的作业级别配置中使用它们。

链接到插件

您有权在远程主机上执行 shell 脚本作为预构建步骤或构建后步骤。

于 2015-08-03T06:11:00.563 回答
0

更新了通过 ssh 发布的路径,它对我有用

于 2021-09-30T08:22:38.860 回答