Skip to content

[JENKINS-53792] Env vars to configure CLI -auth option #20029

Closed

Description

@jenkins-infra-bot

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.


Originally reported by fcojfernandez, imported from: Env vars to configure CLI -auth option
  • assignee: fcojfernandez
  • status: Resolved
  • priority: Major
  • component(s): cli
  • resolution: Fixed
  • resolved: 2018-10-09T07:09:06+00:00
  • votes: 0
  • watchers: 1
  • imported: 2025-11-24
Raw content of original issue

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.

Activity

  1. jenkins-infra-bot commented on Sep 26, 2018

    @jenkins-infra-bot
    Author
    • Remote link associated with this issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions