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

Add logged-in username to batch-task environment vars

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: batch-task-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      In addition to the existing Hudson provided environment vars, it would be very nice to have the username
      of the logged-in user exposed when running batch tasks. The use-case is to be able to send an email
      from the task that contains the username of the user that kicked it off.

      I'd suggest HUDSON_USER as the name of the var.

        Attachments

          Issue Links

            Activity

            Hide
            mdonohue mdonohue added a comment -

            Add dependency

            Show
            mdonohue mdonohue added a comment - Add dependency
            Hide
            kotfu kotfu added a comment -

            I would prefer to see two environment variables, which would expose information
            similar to what a login shell exposes. The USER variable would contain the name
            of the effective user id, and HOME would have the home directory of that user.

            I use hudson to automate deployments of ruby applications that use Capistrano.
            Some of these other command line tools look in $HOME for certain files. Because
            $HOME is not set, I have to set it manually in the hudson with something like:

            HOME=/usr/share/tomcat6 cap -v -v deploy

            This workaround is functional, but if the container is ever run as a different
            user id, it would break.

            Show
            kotfu kotfu added a comment - I would prefer to see two environment variables, which would expose information similar to what a login shell exposes. The USER variable would contain the name of the effective user id, and HOME would have the home directory of that user. I use hudson to automate deployments of ruby applications that use Capistrano. Some of these other command line tools look in $HOME for certain files. Because $HOME is not set, I have to set it manually in the hudson with something like: HOME=/usr/share/tomcat6 cap -v -v deploy This workaround is functional, but if the container is ever run as a different user id, it would break.
            Hide
            mdonohue mdonohue added a comment -

            update summary

            Show
            mdonohue mdonohue added a comment - update summary
            Hide
            scm_issue_link 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)

            Show
            scm_issue_link 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)

              People

              • Assignee:
                mindless Alan Harder
                Reporter:
                noise noise
              • Votes:
                2 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: