[JIRA] (JENKINS-53161) useRepository its not applied

216 views
Skip to first unread message

ncosta@fgtsa.com (JIRA)

unread,
Aug 21, 2018, 8:34:01 AM8/21/18
to jenkinsc...@googlegroups.com
Nuno Costa created an issue
 
Jenkins / Bug JENKINS-53161
useRepository its not applied
Issue Type: Bug Bug
Assignee: Boguslaw Klimas
Attachments: Screenshot_20180821_135206.png
Components: git-parameter-plugin
Created: 2018-08-21 12:33
Priority: Minor Minor
Reporter: Nuno Costa

useRepository does not seem to applied. Every time I set it, it will display No GIT repository configured in SCM configuration. Tried use https protocol, adding ^.*ubuntu16-cmake as regex as well but same message is shown.

My initial use case was to show the branches from the repository that is selected in choices but that seems not to be possible without a build. So I tried to use a fixed repository (for testing) and noticed that useRepository makes the msg to appear.

Additional notes:

  • Running without useRepository, only the branches from the default value are shown (ubuntu16-cmake) even if i choose ubuntu16-maven. Both builds finish ok since it's only checkout the repo.
  • Running the jenkinsfile from SCM, only shows branches from repo where jenkinsfile is located. My use case has 3 repos (jenkinsfile only, ubuntu16-cmake and ubuntu16-maven)
  • Is it possible to pass a variable to useRepository field?

 

Tested with jenkins (2.138) and its plugins fully updated as of 20180821.

 

Example:

properties(
    [parameters(
        [choice(
            choices: ['ubuntu16-cmake', 'ubuntu16-maven'], description: '', name: 'my_choice'), 
            [$class: 'GitParameterDefinition', branch: '', 
                branchFilter: '.*', 
                defaultValue: '', 
                description: '', 
                name: 'my_branch', 
                quickFilterEnabled: false, 
                selectedValue: 'NONE', 
                sortMode: 'NONE', 
                tagFilter: '*', 
                type: 'PT_BRANCH', 
                useRepository: "ssh://git@the-repo/ubuntu16-cmake.git"]]), 
    [$class: 'ThrottleJobProperty', 
    categories: [], 
    limitOneJobWithMatchingParams: false, 
    maxConcurrentPerNode: 0, 
    maxConcurrentTotal: 0, 
    paramsToUseForLimit: '', 
    throttleEnabled: false, 
    throttleOption: 'project']])

node('master'){
    deleteDir()
    checkout(
    [$class: 'GitSCM', branches: [[name: '*/latest']], 
        doGenerateSubmoduleConfigurations: false, 
        extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: '$my_choice']], 
        submoduleCfg: [], 
        userRemoteConfigs: [[credentialsId: 'my-creds', 
        url: 'ssh://git@the-repo/$my_choice.git']]])
    sh 'ls -l'
}

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

ncosta@fgtsa.com (JIRA)

unread,
Aug 21, 2018, 8:39:09 AM8/21/18
to jenkinsc...@googlegroups.com
Nuno Costa updated an issue
Change By: Nuno Costa
Environment: centos7
Reply all
Reply to author
Forward
0 new messages