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

Cannot use Env Var in Task Name

    XMLWordPrintable

Details

    Description

      I'm not sure if this is a bug or not, but I tried putting an environment variable in the Task Name, and it's not consuming it.

      The reason is that we have 1 job (deploy) that deploys based on a parameter (env var), but the pipeline does not expand that environment variable.

      Attachments

        Issue Links

          Activity

            gposton1040 Glenn Poston added a comment -

            Hey Patrik,

            I have a particular build scenario would make what I'm trying to do work (Note that my example is fictitious just to get my idea accross).

            I have a matrix job with a 'User Defined Axis' named 'arguments.' Arguments has two values ('arg1' 'arg2'). The matrix job triggers a parameterized job (let's call this 'param_job') for each value of 'arguments' and passes the AXIS value as a parameter. 'param_job' has it's 'stage' set to 'deploy' and it's 'task' set to '$arguments'.

            Right now when I look at the dashboard with the matrix job as the starting job it looks like this:

            (matrix_job) -> param_job(stage: deploy, task: $arguments)

            The issue here is that this doesn't show that matrix_job kicked of two builds of param_job.

            Once this fix is in, should I expect the dashboard to show this:

            (matrix_job) -> param_job(stage: deploy, task: arg1)
            -> param_job(stage: deploy, task: arg2)

            gposton1040 Glenn Poston added a comment - Hey Patrik, I have a particular build scenario would make what I'm trying to do work (Note that my example is fictitious just to get my idea accross). I have a matrix job with a 'User Defined Axis' named 'arguments.' Arguments has two values ('arg1' 'arg2'). The matrix job triggers a parameterized job (let's call this 'param_job') for each value of 'arguments' and passes the AXIS value as a parameter. 'param_job' has it's 'stage' set to 'deploy' and it's 'task' set to '$arguments'. Right now when I look at the dashboard with the matrix job as the starting job it looks like this: (matrix_job) -> param_job(stage: deploy, task: $arguments) The issue here is that this doesn't show that matrix_job kicked of two builds of param_job. Once this fix is in, should I expect the dashboard to show this: (matrix_job) -> param_job(stage: deploy, task: arg1) -> param_job(stage: deploy, task: arg2)
            gposton1040 Glenn Poston added a comment -

            In response to your question about what to do if the param is not set... I would expect the value of task and stage to act as if the field itself was empty in the case that the param is not set.
            Right now, I believe that task and stage default to the build name (not 100% sure) if the user leaves these fields blank.

            gposton1040 Glenn Poston added a comment - In response to your question about what to do if the param is not set... I would expect the value of task and stage to act as if the field itself was empty in the case that the param is not set. Right now, I believe that task and stage default to the build name (not 100% sure) if the user leaves these fields blank.

            Is there any possibility of implementing something like JENKINS-25377 (Ability to add variables to stage and task name) soon?

            cadsuara Carlos Adsuara added a comment - Is there any possibility of implementing something like JENKINS-25377 (Ability to add variables to stage and task name) soon?
            patbos Patrik Boström added a comment - Fixed in: https://github.com/Diabol/delivery-pipeline-plugin/pull/138

            Released in 0.9.6

            patbos Patrik Boström added a comment - Released in 0.9.6

            People

              Unassigned Unassigned
              grayaii Alex Gray
              Votes:
              8 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated: