Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-18138

Value is not stored as parameter for later use

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I've been testing this plugin and it really doesn't work with current Jenkins release. After choosing version and trying to use that parameter later on, parameter is not recognized using ${param-name} format. I've tried to use this plugin with Artifact resolver plugin.

        Attachments

          Activity

          Hide
          gesh Gesh Markov added a comment -

          That's because it creates multiple parameters based on the name of the parameter name you supply.

          For example if you named the property "MY_JAR" then the selected version from the dropdown will be "MY_JAR_VERSION". Another one that might be interesting depending on what you want to achieve is: "MY_JAR_ARTIFACT_URL".

          You can see the full list in Jenkins the "Parameters" section of an execution of the job.

          Cheers,
          Gesh

          Show
          gesh Gesh Markov added a comment - That's because it creates multiple parameters based on the name of the parameter name you supply. For example if you named the property "MY_JAR" then the selected version from the dropdown will be "MY_JAR_VERSION". Another one that might be interesting depending on what you want to achieve is: "MY_JAR_ARTIFACT_URL". You can see the full list in Jenkins the "Parameters" section of an execution of the job. Cheers, Gesh
          Hide
          ovaris Olli Varis added a comment - - edited

          Thanks for swift reply! Exactly where can I see this info?

          EDIT: found it thanks a lot!

          Show
          ovaris Olli Varis added a comment - - edited Thanks for swift reply! Exactly where can I see this info? EDIT: found it thanks a lot!
          Hide
          gesh Gesh Markov added a comment -

          you're welcome.

          Show
          gesh Gesh Markov added a comment - you're welcome.
          Hide
          integer Kanstantsin Shautsou added a comment -

          Entered value must be stored without modification

          Show
          integer Kanstantsin Shautsou added a comment - Entered value must be stored without modification
          Hide
          danielbeck Daniel Beck added a comment -

          Kanstantsin Shautsou Could you explain in more detail why you're reopening this, what the problem is?

          Show
          danielbeck Daniel Beck added a comment - Kanstantsin Shautsou Could you explain in more detail why you're reopening this, what the problem is?
          Hide
          integer Kanstantsin Shautsou added a comment - - edited

          This plugin is injecting variables in form of artifactname+tail. If i'm entering input value name as KEY then it must be a KEY, no magic substitution.

          Show
          integer Kanstantsin Shautsou added a comment - - edited This plugin is injecting variables in form of artifactname+tail. If i'm entering input value name as KEY then it must be a KEY, no magic substitution.
          Hide
          danielbeck Daniel Beck added a comment -

          This plugin is injecting variables in form of artifactname+tail, so when artifactname has dash this variable become unusuable for shell.

          It uses the parameter name for it, not the artifact name.

          If i'm entering input value name as KEY then it must be a KEY, no magic substitution.

          As they say in Wikipedia: citation needed. Its behavior is documented in the inline help, and the ParameterDefinition Javadoc only states:

          The actual meaning and the purpose of parameters are entirely up to users, so what the concrete parameter implmentation is pluggable. Write subclasses in a plugin and put Extension on the descriptor to register them.

          FWIW If you want parameter name = env variable set with input, that's a minor improvement at best, not a blocker bug.

          Show
          danielbeck Daniel Beck added a comment - This plugin is injecting variables in form of artifactname+tail, so when artifactname has dash this variable become unusuable for shell. It uses the parameter name for it, not the artifact name. If i'm entering input value name as KEY then it must be a KEY, no magic substitution. As they say in Wikipedia: citation needed. Its behavior is documented in the inline help, and the ParameterDefinition Javadoc only states: The actual meaning and the purpose of parameters are entirely up to users, so what the concrete parameter implmentation is pluggable. Write subclasses in a plugin and put Extension on the descriptor to register them. FWIW If you want parameter name = env variable set with input, that's a minor improvement at best, not a blocker bug.
          Hide
          gesh Gesh Markov added a comment -

          As stated in the wiki documentation the variable names are suffixed with _TAIL which makes them perfectly accessible on the command line.

          There are different use cases for this plugin and jenkins doesn't provide a convention for a single parameter being able to create multiple variables, so I just created my own.

          If you enter a parameter value from a command-line job trigger for KEY it will be echoed back as KEY_VERSION, which I admit is awkward. But until jenkins adds a way to define multiple variables from a single parameter awkward is the best you will get from this plugin.

          Show
          gesh Gesh Markov added a comment - As stated in the wiki documentation the variable names are suffixed with _TAIL which makes them perfectly accessible on the command line. There are different use cases for this plugin and jenkins doesn't provide a convention for a single parameter being able to create multiple variables, so I just created my own. If you enter a parameter value from a command-line job trigger for KEY it will be echoed back as KEY_VERSION, which I admit is awkward. But until jenkins adds a way to define multiple variables from a single parameter awkward is the best you will get from this plugin.
          Hide
          integer Kanstantsin Shautsou added a comment -

          If you have configured input parameters from other plugins and want change them to this plugin - you fail. Because it creates other values. Storing additional variables is ok. But input parameter must be the same that people is entering. This maybe easily fixed with just adding entered value to environment in addition to your existed.

          Show
          integer Kanstantsin Shautsou added a comment - If you have configured input parameters from other plugins and want change them to this plugin - you fail. Because it creates other values. Storing additional variables is ok. But input parameter must be the same that people is entering. This maybe easily fixed with just adding entered value to environment in addition to your existed.
          Hide
          integer Kanstantsin Shautsou added a comment -

          Btw, i'm unable to PR this simple improvement because of annotated framework. It's a first plugin in jenkins that i can't just open in IDEA and start working... Real dependencies are in profiles, java sources in wrong directory, wrong package name. Do you really need this complexity just for 3 classes?

          Show
          integer Kanstantsin Shautsou added a comment - Btw, i'm unable to PR this simple improvement because of annotated framework. It's a first plugin in jenkins that i can't just open in IDEA and start working... Real dependencies are in profiles, java sources in wrong directory, wrong package name. Do you really need this complexity just for 3 classes?

            People

            Assignee:
            gesh Gesh Markov
            Reporter:
            ovaris Olli Varis
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: