程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Jenkins Mercurial插件无法检测到更改大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决jenkins Mercurial插件无法检测到更改?

开发过程中遇到jenkins Mercurial插件无法检测到更改的问题如何解决?下面主要结合日常开发的经验,给出你关于jenkins Mercurial插件无法检测到更改的解决方法建议,希望对你解决jenkins Mercurial插件无法检测到更改有所启发或帮助;

通过在“全局工具”中添加Mercurial安装,并将管道脚本更改为,我能够使轮询正常工作

pipeline {
    agent any
    stages {
        stage('checkout') {
            steps {
                checkout([$class: 'MercurialSCM', credentialsID: 'jenkins', installation: 'Mercurial', source: 'ssh://hg-user@hg-server/test-repo'])
            }
        }
        stage('Tests') {
            steps {
                echo "Hello World"
            }
        }
    }
}

同时保持选中“轮询”选项,并且当然第一次手动运行管道以获取参变更集。

解决方法

当我的管道轮询Mercurial存储库以查找更改时,它不会检测到任何更改,并且不会触发新的构建。

在插件文档之后,我设置了一个推钩来触发轮询,这种方法可以正常工作,但无法检测到更改。我所得到的是

我正在使用:-jenkins v2.107.3-Mercurial插件v2.3

我刚刚创建了一个测试Mercurial回购,其中包含一些具有随机内容的文件以测试设置,还有一个詹金斯管道“ polling-test”,用于检查回购并回显“
Hello world”。

pipeline {
    agent any
    stages {
        stage('checkout') {
            steps {
                checkout changelog: true,poll: true,scm: [
                        $class: 'MercurialSCM',credentialsId: 'jenkins',revision: 'default',revisionType: 'BRANCH',source: 'ssh://hg-user@hg-server/test-repo'
                    ]
            }
        }
        stage('Tests') {
            steps {
                echo "Hello World"
            }
        }
    }
}

此外,轮询SCM选项也已签出,没有任何计划。

我修改存储库,方法如下:

$ echo "foo" > bar
$ hg add bar
$ hg commit -m "change"
$ hg push

然后通过以下方式触发轮询

$ curl "https://jenkins-server/mercurial/notifyCommit?url=ssh://hg-user@hg-server/test-repo"
scheduled polling of polling-test

轮询日志显示它已触发,但未发现更改。

我究竟做错了什么?如何检测变化?

大佬总结

以上是大佬教程为你收集整理的Jenkins Mercurial插件无法检测到更改全部内容,希望文章能够帮你解决Jenkins Mercurial插件无法检测到更改所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: