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

Env vars to configure CLI -auth option

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: cli
    • Labels:
      None
    • Similar Issues:
    • Released As:
      Jenkins 2.145

      Description

      As a Jenkins CLI user I would like to have the ability to invoke Jenkins CLI commands in an easier way by preconfiguring the -auth option.

      In a similar way that the environment variable JENKINS_URL allows to execute different CLI command without specifying the -s option continuously, environment variable such JENKINS_USER_ID and JENKINS_API_TOKEN might help configuring easily the executions without specifying the -auth option in each executed command.

      Idea
      Before

      java -jar jenkins-cli.jar -s https://jenkins.mycompany.com/ -auth my-user:1234567890abcdef my-command
      

      After

      export JENKINS_URL=https://jenkins.mycompany.com/
      export JENKINS_USER_ID=my-user
      export JENKINS_API_TOKEN=1234567890abcdef
      java -jar jenkins-cli.jar my-command
      

      In case the -auth option is specified, its value will prevail, although the env vars will not be unset for later use.

        Attachments

          Issue Links

            Activity

            fcojfernandez Francisco Fernández created issue -
            fcojfernandez Francisco Fernández made changes -
            Field Original Value New Value
            Status Open [ 1 ] In Progress [ 3 ]
            fcojfernandez Francisco Fernández made changes -
            Summary Env var to configure auth Env vars to configure CLI -auth option
            fcojfernandez Francisco Fernández made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            fcojfernandez Francisco Fernández made changes -
            Remote Link This issue links to "PR@ (Web Link)" [ 21843 ]
            fcojfernandez Francisco Fernández made changes -
            Remote Link This issue links to "PR@ (Web Link)" [ 21843 ]
            fcojfernandez Francisco Fernández made changes -
            Remote Link This issue links to "PR#3653 (Web Link)" [ 21844 ]
            oleg_nenashev Oleg Nenashev made changes -
            Released As Jenkins 2.145
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]

              People

              Assignee:
              fcojfernandez Francisco Fernández
              Reporter:
              fcojfernandez Francisco Fernández
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: