下载安装
1  | wget http://mirrors.jenkins-ci.org/war-stable/latest/jenkins.war  | 
启动后如果遇到以下错误:1
2
3javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
...
则可以通过修改${JENKINS_HOME}/hudson.model.UpdateCenter.xml文件来解决:
1  | 
  | 
安装插件
1  | wget http://mirrors.jenkins-ci.org/plugins/publish-over-ssh/latest/publish-over-ssh.hpi  | 
配置 SSH Server
Manage Jenkins > Configure System > Publish over SSH > SSH Servers > Add SSH Server

创建 Freestyle Job



SSH Publishers 中的 Remote directory 是相对于 SSH Servers 中设置的 Remote Directory 的;建议将 SSH Servers 中的 Remote Directory 设置为根目录,若不设置,那么打包后的文件可能无法上传到 SSH Publishers 中设置的 Remote directory 目录。