声明性Jenkinsfile CIFS共享

时间:2017-06-20 08:17:21

标签: jenkins jenkins-pipeline

我还有关于jenkins管道的另一个问题。

如何将构建工件发布到Windows共享?在正常构建作业中,有一个“CIFS Publisher”构建后操作。但我怎么能在

中使用它
post{
    success {
       //publish build artifacts
    }
}

有什么例子吗?

2 个答案:

答案 0 :(得分:3)

我已成功地以这种方式管理它:

cifsPublisher alwaysPublishFromMaster: false, continueOnError: false, failOnError: false, publishers: [[
  configName: 'NAME_OF_THE_CIFS_CONFIG', transfers: [[
    cleanRemote: false, 
    excludes: '', 
    flatten: false, 
    makeEmptyDirs: false, 
    noDefaultExcludes: false, 
    patternSeparator: '[, ]+', 
    remoteDirectory: '$BUILD_NUMBER', 
    remoteDirectorySDF: false, 
    removePrefix: '', 
    sourceFiles: 'myfile']], 
  usePromotionTimestamp: false, 
  useWorkspaceInPromotion: false, 
  verbose: true
]]

答案 1 :(得分:0)

请使用Jenkins中的自动生成工具为您提供帮助。 enter image description here

您会看到突出显示链接。点击它。 enter image description here

填写您期望的所有必需值。

向下滚动并单击生成管道脚本后,您将看到所需的语法。

enter image description here

最后一步,将生成的脚本复制到成功子句中。