天天看点

jenkins(5)——使用插件Publish over SSH

1.先下载插件Publish over SSH

2.到系统设置编辑Publish over SSH

jenkins(5)——使用插件Publish over SSH

公共配置:

Passphrase:密码(key的密码,如果你设置了)

Path to key:key文件(私钥)的路径,这个和下面的key可以不用输入

Key:将私钥复制到这个框中

Disable exec:禁止运行命令

私有配置:

SSH Server Name:标识的名字(随便你取什么)

Hostname:需要连接ssh的主机名或ip地址(建议ip)

Username:用户名

Remote Directory:远程目录

Use password authentication, or use a different key:可以替换公共配置(选中展开的就是公共配置的东西,这样做扩展性很好)

私有配置的高级:

Port:端口(默认22)

Timeout (ms):超时时间(毫秒)默认即可

Disable exec:禁止运行命令

Test Configuration:测试连接 

点击Test Configuration查看是否连接成功

3.项目配置

jenkins(5)——使用插件Publish over SSH

Source files:相当于jenkins中的workspace里面你的项目路径

Remove prefix:自己需要过滤的文件

Remote directory:相当于在刚刚在系统配置中下面加个cbp文件夹

Exec command:最后执行的命令

jenkins(5)——使用插件Publish over SSH
jenkins(5)——使用插件Publish over SSH
jenkins(5)——使用插件Publish over SSH