Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkins pipeline can't load the assigned git repository #24

Open
hvsop opened this issue Dec 20, 2021 · 3 comments
Open

Jenkins pipeline can't load the assigned git repository #24

hvsop opened this issue Dec 20, 2021 · 3 comments

Comments

@hvsop
Copy link

hvsop commented Dec 20, 2021

Hello everyone,

I am using jenkins version 2.303.3 and git parameter plugin version 0.9.14, and setup jenkins pipeline as below, then committed the pipeline code to "git@repository_b.git' :

###################

pipeline {

agent {
label "any"
}
environment {
gitUrl = 'git@repository_a.git'
}

parameters {
gitParameter name: 'branchName',
description: '',
type: 'PT_BRANCH_TAG',
defaultValue: 'origin/master',
branch: '',
branchFilter: '.',
tagFilter: '
',
sortMode: 'NONE',
selectedValue: 'NONE',
useRepository: env.gitUrl,
quickFilterEnabled: 'false',
listSize: '10'
}

    stage('Pull SCM'){
      steps {
        echo "Checkout codes"
        checkout([$class: 'GitSCM', branches: [[name: env.branchName]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: "jenkins", url: env.gitUrl]]])
      }
    }

}

}

###################

After successfully built the jenkins job, I found the jenkins pipeline parameters "branchName" , was load branches from the jenkins pipeline repository (repository_b.git), instead of the correct one(git@repository_a.git), isn't the repository should be used from the env.gitUrl repository in the parameters section ?

Please help.

@hvsop
Copy link
Author

hvsop commented Dec 22, 2021

can anyone help please? Thanks.

@hvsop
Copy link
Author

hvsop commented Dec 28, 2021

anyone here?

@hvsop
Copy link
Author

hvsop commented Jan 5, 2022

anyone can help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant