在Jenkins管道结帐中禁用变更日志 [英] Disable changelog in Jenkins pipeline checkout

查看:65
本文介绍了在Jenkins管道结帐中禁用变更日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Jenkins管道,可以从几个不同的存储库中检出特定的提交.我想禁用 changeSet (更改日志)的计算,因为对该作业的/api/json调用需要花费很长时间进行计算(无论如何,更改日志对该作业都不重要)

I have a Jenkins pipeline that checks out specific commits from several different repos. I would like to disable the calculation of the changeSet (changelog) since the /api/json call to the job takes a long time to compute (and the changelog is not important for that job in any case).

在管道中,我使用以下代码检出代码:

In the pipeline I'm checking out the code with:

checkout([$class: 'GitSCM',
branches: [[name: commitHash]],
doGenerateSubmoduleConfigurations: false,
submoduleCfg: [],
changelog: false,
poll: false,
userRemoteConfigs: [[url: gitUrl]]])

我认为将 changelog 设置为false可以防止这种情况,但是当我为作业调用/api/json 页面时,我仍然可以看到 changeSet填充.

I thought that setting changelog to false would prevent that, but when I call the /api/json page for the job I can still see the changeSet populated.

我想念什么?

更新

请清楚一点,我为该作业看到的更改日志与我正在管道中使用以上代码检出的所有作业有关.我不介意从中检出Jenkinsfile的git仓库的变更日志,但我不想将所有项目的变更日志作为管道阶段的一部分包括进来.

Just to be clear, the change logs I see for that job are related to all the jobs I'm checking out with the code above within the pipeline. I don't mind to have the changelog of the git repository where the Jenkinsfile is checked out from, but I don't want to include the changelogs of all the projects checked out as part of the pipeline stages.

管道配置中的 lightweight checkout 模式是否与此有关?

Does the lightweight checkout mode in the pipeline configuration has anything to do with it?

推荐答案

您可以禁用更改日志.这已经在这里得到回答: Jenkins管道:如何在不触发轮询的情况下签出存储库或跟踪更改?

You can disable the changelog. That was already answered here: Jenkins pipeline: How to checkout repository without triggering polling or tracking changes?

您还可以直接在sh块中使用git命令.

You could use also the git command directly from a sh block.

这篇关于在Jenkins管道结帐中禁用变更日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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