“p4sync"的 Jenkins 流水线语法 [英] Jenkins Pipeline Syntax for "p4sync"

查看:28
本文介绍了“p4sync"的 Jenkins 流水线语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的管道脚本中同步到 Perforce,但来自 文档我看不到设置工作区行为"的方法,即使插件本身似乎有 那个能力.

I'm trying to sync to Perforce in my pipeline script, but from the documentation I don't see a way to set the "workspace behavior", even though the plugin itself seems to have that capability.

我希望工作区"等同于设置手动(自定义视图)",我可以按照描述在 UI 中配置 这里.我需要将哪些参数传递给 p4sync 任务来实现?

I want the "workspace" to be equivalent to the setting "Manual (custom view)" I can configure in the UI as described here. What parameters do I need to pass to the p4sync task to achieve that?

推荐答案

您需要使用完整的 checkout DSL,p4sync DSL 只是基本的.最简单的方法是使用代码片段生成器(Pipeline Syntax 链接),从 SCM 列表中选择 checkout: General SCM 然后 Perforce Software.

You will need to use the full checkout DSL, the p4sync DSL is only basic. The easiest way is to use the snippet generator (Pipeline Syntax link), select checkout: General SCM then Perforce Software from the SCM list.

然后您将能够定义详细视图.例如:

You will then be able to define a detailed View. For example:

checkout([
  $class: 'PerforceScm', 
  credential: 'phooey1666', 
  populate: [
    $class: 'AutoCleanImpl', 
    delete: true, 
    modtime: false, 
    pin: '', 
    quiet: true, 
    replace: true
  ], 
  workspace: [
    $class: 'ManualWorkspaceImpl', 
    charset: 'none', 
    name: 'jenkins-${NODE_NAME}-${JOB_NAME}', 
    pinHost: false, 
    spec: [
      allwrite: true, 
      clobber: false, 
      compress: false, 
      line: 'LOCAL', 
      locked: false, 
      modtime: false, 
      rmdir: false, 
      streamName: '',
      view: '''
        //depot/... //jenkins-${NODE_NAME}-${JOB_NAME}/...
        -//depot/tests/... //jenkins-${NODE_NAME}-${JOB_NAME}/tests/...'''
    ]
  ]
])

这篇关于“p4sync"的 Jenkins 流水线语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆