Jenkins 管道民意调查 perforce [英] Jenkins pipeline poll perforce
问题描述
继续jenkins-pipeline-syntax-for-p4sync - 我是无法为我的管道工作获得轮询 SCM"选项.这是我的配置:
- 选中轮询 SCM"并设置为每 10 分钟轮询一次
- 管道脚本包含以下内容:
<前>node ('some-node')//不是实际值{阶段(结帐"){查看([$class: 'PerforceScm',credential: '11111111-1111-1111-1111-11111111111',//不是实际值填充:[$class: 'AutoCleanImpl',删除:真,修改时间:假,平行线: [启用:假,minbytes: '1024',minfiles: '1',路径:'/usr/local/bin/p4',线程:'4'],别针: '',安静:真的,替换:真],工作区:[$class: 'ManualWorkspaceImpl',字符集:'无',名称:'jenkins-${NODE_NAME}-${JOB_NAME}',pinHost:假,规格:[全写:假,破坏者:错误,压缩:假,行:'本地',锁定:假,修改时间:假,rmdir:假,流名:'',view: '//仓库/子文件夹...//jenkins-${NODE_NAME}-${JOB_NAME}/...'//不是实际值]]])}
stage ('现在做点什么'){sh 'ls -la'}}
- 手动运行一次作业
但在 GUI 中配置 perforce 源和轮询 SCM 时,轮询不起作用,并且作业没有像非流水线作业那样的Perforce 软件轮询日志"链接.就像 PerforceSCM 缺少投票:真实设置 - 或者我做错了什么.
目前我有一个解决方法,我在触发流水线作业的非流水线作业中轮询 perforce,但是我必须手动传递更改列表,我宁愿流水线作业来做所有事情.
版本
詹金斯 - 2.7.4
P4 插件 - 1.4.8
管道插件 - 2.4
Pipeline SCM Step 插件 - 2.2
如果您转到 Groovy 代码段生成器并选中包含在轮询中"复选框,您会看到生成的代码包含一个行项目:
结帐([民意调查:是的,
顺便说一句,您目前在工作区名称中使用 ${NODE_NAME} 可能会遇到问题.轮询在主服务器上运行,因此它可能无法正确找到您之前构建的更改编号.如果是这样的话,我知道它应该很快就会修复.
In continuation to jenkins-pipeline-syntax-for-p4sync - I am not able to get the "Poll SCM" option work for my pipeline job. Here is my configuration:
- "Poll SCM" is checked and set to poll every 10 minutes
- Pipeline script contains the following:
node ('some-node') // not actual value
{
stage ('checkout')
{
checkout([
$class: 'PerforceScm',
credential: '11111111-1111-1111-1111-11111111111', // not actual value
populate: [
$class: 'AutoCleanImpl',
delete: true,
modtime: false,
parallel: [
enable: false,
minbytes: '1024',
minfiles: '1',
path: '/usr/local/bin/p4',
threads: '4'
],
pin: '',
quiet: true,
replace: true
],
workspace: [
$class: 'ManualWorkspaceImpl',
charset: 'none',
name: 'jenkins-${NODE_NAME}-${JOB_NAME}',
pinHost: false,
spec: [
allwrite: false,
clobber: false,
compress: false,
line: 'LOCAL',
locked: false,
modtime: false,
rmdir: false,
streamName: '',
view: '//Depot/subfolder... //jenkins-${NODE_NAME}-${JOB_NAME}/...' // not actual value
]
]
]
)
}
stage ('now do something')
{
sh 'ls -la'
}
}
- Ran the job manually once
Still, polling does not work and job does not have a "Perforce Software Polling Log" link like a non-pipelined job has when configuring the perforce source and Poll SCM in the GUI. It's like the PerforceSCM is missing a poll: true setting - or i'm doing something wrong.
Currently I have a workaround in which I poll perforce in a non-pipelined job which triggers a pipelined job, but then I have to pass the changelists manually and I would rather the pipeline job to do everything.
edit: versions
jenkins - 2.7.4
P4 plugin - 1.4.8
Pipeline plugin - 2.4
Pipeline SCM Step plugin - 2.2
If you go to the Groovy snippet generator and check the "include in polling" checkbox, you'll see that the generated code includes a line item for it:
checkout([
poll: true,
As an aside, you may run into problems at the moment using ${NODE_NAME} in your workspace name. The polling runs on the master, so it might not properly find the change number of your previous build. If that's the case, I know a fix for it should be coming shortly.
这篇关于Jenkins 管道民意调查 perforce的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!