Env vars to configure CLI -auth option

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Jenkins 2.145

      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.

            Assignee:
            Francisco Fernández
            Reporter:
            Francisco Fernández
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: