• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • batch-task-plugin
    • None
    • Platform: All, OS: All

      I have looked around and even peeked into the source code(not good enough to
      change it myself yet) but I can't seem to find any indication that the Task Id
      is placed in the env. This would be a very handy thing to have to identify
      specific task runs in the build itself

      I hope this isn't a duplicate, I checked the issue tracker and mailing lists but
      if it is sorry.

      -martin

          [JENKINS-1316] Add Task Id to the environment variables

          Yes, this is useful, but it requires me to first take care of issue #992.

          Kohsuke Kawaguchi added a comment - Yes, this is useful, but it requires me to first take care of issue #992.

          Alan Harder added a comment -

          I'm looking at env vars when running tasks (related to JENKINS-5039 and JENKINS-1628), so I could cover this one too.. are you really asking for the env when running batch task ABC to contain a var like BATCH_TASK=ABC ? not sure why you'd need a var since ABC is its own script.. the var is always the same (unless you rename the task..), so wanted to make sure this is what you meant.

          Alan Harder added a comment - I'm looking at env vars when running tasks (related to JENKINS-5039 and JENKINS-1628 ), so I could cover this one too.. are you really asking for the env when running batch task ABC to contain a var like BATCH_TASK=ABC ? not sure why you'd need a var since ABC is its own script.. the var is always the same (unless you rename the task..), so wanted to make sure this is what you meant.

          mortis added a comment -

          No actually I was talking about the identifier for the task run, not the task name. So something like #1275-2 where 1275 is the build and -2 is the 2nd time the task has been run on that build.

          mortis added a comment - No actually I was talking about the identifier for the task run, not the task name. So something like #1275-2 where 1275 is the build and -2 is the 2nd time the task has been run on that build.

          Alan Harder added a comment -

          gotcha.. this makes more sense, thanks.

          Alan Harder added a comment - gotcha.. this makes more sense, thanks.

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/plugins/batch-task/src/main/java/hudson/plugins/batch_task/BatchRun.java
          trunk/hudson/plugins/batch-task/src/test/java/hudson/plugins/batch_task/BatchTaskTest.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=25330
          Log:
          [FIXED JENKINS-5039] [FIXED JENKINS-1628] [FIXED JENKINS-1316]
          Environment variable bugfix (global/node variables not set in env for tasks)
          and enhancements (add TASK_ID env var, add HUDSON_USER if task triggered by user)

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/plugins/batch-task/src/main/java/hudson/plugins/batch_task/BatchRun.java trunk/hudson/plugins/batch-task/src/test/java/hudson/plugins/batch_task/BatchTaskTest.java http://fisheye4.cenqua.com/changelog/hudson/?cs=25330 Log: [FIXED JENKINS-5039] [FIXED JENKINS-1628] [FIXED JENKINS-1316] Environment variable bugfix (global/node variables not set in env for tasks) and enhancements (add TASK_ID env var, add HUDSON_USER if task triggered by user)

            mindless Alan Harder
            mortis mortis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: