[JIRA] (JENKINS-58619) execute commands such as git inside jenkins DSL plugin having dynamic parameters

3 views
Skip to first unread message

sr.forwards@gmail.com (JIRA)

unread,
Jul 23, 2019, 2:06:03 PM7/23/19
to jenkinsc...@googlegroups.com
SR created an issue
 
Jenkins / Bug JENKINS-58619
execute commands such as git inside jenkins DSL plugin having dynamic parameters
Issue Type: Bug Bug
Assignee: Bruno P. Kinoshita
Components: active-choices-plugin, groovy-plugin
Created: 2019-07-23 18:05
Environment: Jenkins ver. 2.164.2
Active Choices Plug-in 2.1
Labels: jenkins ActiveChoices Plugins groovy-script
Priority: Minor Minor
Reporter: SR

Would like to generate dynamic choices from git repository. So, within groovySrcipt's script section,

 

properties([
 parameters([ 
  [$class: 'ChoiceParameter',
   choiceType: 'PT_SINGLE_SELECT',
   description: 'Choose env',
   name: 'ENVIRONMENT',
   sandbox: true,
   script: 'return["none","dev","int","prod"]' ] 
script: [ 
   $class: 'GroovyScript',
    fallbackScript: [
 classpath: [], 
   sandbox: true, 
   script: 'return[\'Environment not found\']' ], 
   script: [ classpath: [], ] ], 
    [$class: 'CascadeChoiceParameter', 
     choiceType: 'PT_SINGLE_SELECT', 
     description: 'Choose snapshot for selected env', 
     name: 'SNAPSHOT', 
     referencedParameters: 'ENVIRONMENT', 
     script: [ $class: 'GroovyScript', 
     fallbackScript: 
     [ classpath: [], 
     sandbox: true, 
      script: 'return["FAILED"]' ], 
      script: [ classpath: [], 
      sandbox: true, 
      script: """ 
           def snapshotsL = "git tag -l --sort=v:refname \"v*-SNAPSHOT\" | tail -5" 
            return [snapshotsL] """ ] ] ] ]) ])


Above script always returns FAILED. Either I am not sure, how to capture the git command out and return or this functionality isn't available.

Please assist.
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages