成功构建后,从远程计算机上的工作区执行Shell脚本(Jenkins) [英] Execute Shell script from workspace on remote machine after build successful (Jenkins)

查看:299
本文介绍了成功构建后,从远程计算机上的工作区执行Shell脚本(Jenkins)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

情况是-我有一个作业A,该作业运行我的蚂蚁脚本并为我打包工件.

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

我还使用参数化的触发式插件来触发我的作业B",这将把我的工件部署到远程计算机上.

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

工作A正常工作,工作B正常.

The job A is working fine and also Job B.

我必须对作业B执行的任务是

The tasks that i have to perform with Job B are

  1. GIT签出(包含我的部署脚本)(成功执行).
  2. 将工件从以前的版本复制到远程计算机. (成功完成)
  3. 在远程计算机上运行shell脚本(工作空间文件夹中存在脚本)-面临的问题.

我浏览了各种插件,但没有人允许我在Post build action中出现"SCP to remote machine"之后运行shell脚本.

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.

谢谢.!

推荐答案

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

To solve my query i used Jenkins SSH Plugin. This provides a configuration tab where i can add multiple hosts and after that used them in my job level configuration.

链接到插件

您有特权在构建前或构建后步骤中在远程主机上执行Shell脚本.

you get privilege to execute shell script on remote host as pre-build step or post build step.

这篇关于成功构建后,从远程计算机上的工作区执行Shell脚本(Jenkins)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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