如何在管道中使用通过ssh插件发布 [英] How to use publish over ssh plugin in pipeline

查看:50
本文介绍了如何在管道中使用通过ssh插件发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从Windows上托管的Jenkins SSH到linux服务器,并在linux机器上执行命令,我尝试通过ssh插件安装publish,并在全局配置中测试了连接,并且工作正常,我不知道如何继续进行下一步.任何帮助将不胜感激.

I would like to SSH to linux server from Jenkins hosted on windows and execute a command over in linux machine, I tried installing publish over ssh plugin and tested the connection in global config and it works fine, I don't know how to proceed next in pipeline. Any help would be appreciated.

推荐答案

如果您使用的是管道项目 Jenkinsfile ,那么您要做的就是进入您在Jenkins中的项目,然后单击配置.在配置的管道部分中,底部有一个链接管道语法".它将带您到代码段生成器.它的自我解释,在我们的案例中,它允许生成"ssh上的发布"片段,您将这些片段添加到您的Jenkinsfile中(将其添加到阶段定义内的steps部分).在生成器中,您可以定义要发布的内容,运行shell命令的选项等.

If you are using a pipeline project and a Jenkinsfile, then all you need to do is go into your project in Jenkins and click configure. In the pipeline section of the configuration, at the bottom there is a link "pipeline syntax". It will take you to the Snippet Generator. Its self explanatory and in our case it allows to generate "publish over ssh" snippets that you would add to your Jenkinsfile (add it to a steps section inside a stage definition). In the generator you can define what to publish, options to run a shell command, etc. source

这篇关于如何在管道中使用通过ssh插件发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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