-
Bug
-
Resolution: Unresolved
-
Blocker
-
None
After migrating our Bitbucket instance to a new server with a new IP address, we're not able to change the IP address to point jenkins at the new server. the Bitbucket server is behind a proxy `bitbucket.our.domain` and the url has not changed. in the pipeline, we define the scm in the first step of the first stage:
scm: [ $class: 'GitSCM', branches: [[name: "${BRANCH}"]], userRemoteConfigs: [[credentialsId: '*******************************',url: 'ssh://git@bitbucket.our.domain:7999/project/repository.git']] ]
with pipelines, the Source Code Management section does not exist, so this is the only place that the remote url is defined. Yet, when trying to Build with Parameters we get the attatched error, which is clearly not the url that has been defined.
I assume that you are using static agents and thus are reusing workspaces. The git plugin is not sophisticated enough to apply the change of remote URL (or any other remote settings) to the existing workspace. If that is the case, then you can temporarily modify the pipeline script to precede the checkout scm step with a deleteDir step. That will erase the working repository in the workspace, it will then be cloned from the new URL and will write the new URL into the workspace.
Same problem exists when a job definition changes from using a shallow clone to not using a shallow clone, or from not using a reference repository to using a reference repository. The git client plugin and the git plugin record state data about the repository in the workspace but do not force the repository in the workspace to match the current values of the plugin state data.