前置条件
- 添加ssh登录凭证
可参考本人的这边博客: https://www.jianshu.com/p/4477fa8106cf
2.在jenkins中创建Credentials.
可参考本人的这篇博客: https://www.jianshu.com/p/0b8564b78f98
- jenkins已安装好了ssh插件
一. 新增 ssh sites
系统管理 >> 系统设置 >> SSH remote hosts 新增 SSH sites
![](https://img.haomeiwen.com/i1890600/e31e74cdaffe5dbf.png)
![](https://img.haomeiwen.com/i1890600/bfca5193ed03742d.png)
二. 在jenkins的job中配置执行远程shell
![](https://img.haomeiwen.com/i1890600/b9c4b42c65fd13d4.png)
![](https://img.haomeiwen.com/i1890600/fdb74dfafb50bb94.png)
网友评论