branch conflict in Git Plugin

34 views
Skip to first unread message

YONGXIANG GAO

unread,
Mar 22, 2021, 12:34:06 AM3/22/21
to Jenkins Users
I have a jenkins job to run builds against multiple repositories (one repo for each build).
And from time to time, we see git tries to checkout revision from some old repository.
We already use "Wipe out repository & force clone"
Do you know how can we do to fix it?
The partial groovy script of the job is posted below. (seemly the branches spec is not useful).
Thanks a lot.
--Yongxiang

    scm {

        git {

            remote { url('$REPO_URL') }

            branches(':(master|main)')

            extensions {

                wipeOutWorkspace()

            }

            // buildSingleRevisionOnly() is Dynamic DSL, which is not supported

            // by our DSL linter. This configure block is meant to be the same

            // as `extensions { buildSingleRevisionOnly() }`.

            configure {

                scm -> scm / extensions << {

                    'hudson.plugins.git.extensions.impl.BuildSingleRevisionOnly'()

                }

            }

        }

    }


    parameters {

        stringParam('REPO_URL', '', 'URL to the repository')

    }

Reply all
Reply to author
Forward
0 new messages