nishio-dens / bitbucket-pullrequest-builder-plugin

Bitbucket Pull Request Builder Plugin for Jenkins
Other
125 stars 145 forks source link

Using Jenkins UI Replay button fails #212

Open ejrgilbert opened 5 years ago

ejrgilbert commented 5 years ago

When trying to rerun a build by clicking the "Replay" button on the Jenkins UI, it fails. The variables aren't defined in the replayed build (as you can see by the null values):

git config remote.origin.url ssh://git@<bitbucket.url>:7999/null/null.git

This occurs when running a pipeline job with the trigger configured through the UI, the pipeline is SCM'ed, and the checkout is defined inside the pipeline itself as follows:

checkout([
    $class: 'GitSCM',
    branches: [[name: "*/${env.sourceBranch}"]],
    doGenerateSubmoduleConfigurations: false,
    extensions: [
        [
            $class: 'PreBuildMerge'],
            options: [mergeRemote: 'origin', mergeTarget: "${env.targetBranch}"]
    ],
    submoduleCfg: [],
    userRemoteConfigs: [[
        credentialsId: 'place-cred-id-here',
        refspec: '+refs/pull-requests/*: refs/remotes/origin/pr/*',
        url: "ssh://git@<bitbucket.url>:7999/${env.destinationRepositoryOwner}/${env.destinationRepositoryName}.git"
    ]]
])
CodeMonk commented 5 years ago

I agree. Both the Build Now and Replay functions have never worked.

I'm changing this into an enhancement, and hoping someone wants to work on it!

HeidiRechek commented 2 years ago

following