【问题标题】:How do I correctly use the jenkins 'publish over ssh' plugin in a jenkinsfile?如何在 jenkinsfile 中正确使用 jenkins 'publish over ssh' 插件?
【发布时间】:2018-05-11 21:34:45
【问题描述】:

https://jenkins.io/doc/pipeline/steps/publish-over-ssh/#code-sshpublisher-code-send-build-artifacts-over-ssh 上的文档不太清楚...

sshPublisher publishers transfer sourceFiles: '/appdata/jenkins/jobs/project/otcm-${pom.version}.tar.gz'

上面给出了“没有这样的属性”错误。正确的语法是什么?

我的詹金斯文件:

node {
stage 'Clean Up'
deleteDir()

stage 'Env Setup'
env.JAVA_HOME = "${tool 'JDK 8'}"
def mvnHome = tool '3.0.3'

stage 'Compile/Package'
checkout scm

stage 'Compile/Package - Get app version'

def pom = readMavenPom file: 'pom.xml'

echo "${pom.version}"

stage 'Compile/Package - Compile and upload to S3'
sh "${mvnHome}/bin/mvn clean install -DskipTests"

/* should i bother with pushing to s3 since snapshot? */
stage 'Push to S3'

stage 'Install'
sh "ssh devci@server 'rm -rf /appdata/devci/app'"
sh "ssh devci@server 'mkdir /appdata/devci/app'"

/* ssh push the tar to remote dir */
/* use the jenkins sshPublisher??? */

/* Remote - explode tar */
/* Remote - download project properties */
/* Remove - start app without new relic using custom port 8007 */

}

【问题讨论】:

    标签: jenkins continuous-integration jenkins-plugins


    【解决方案1】:

    所以有这个管道 sn-p 生成器!

    https://jenkins.io/blog/2016/05/31/pipeline-snippetizer/

    对初学者非常有用!

    【讨论】:

      猜你喜欢
      • 2023-02-11
      • 1970-01-01
      • 2019-10-31
      • 2018-08-02
      • 1970-01-01
      • 2014-04-16
      • 1970-01-01
      • 2016-10-13
      • 1970-01-01
      相关资源
      最近更新 更多