Skip to content

[JENKINS-27045] Jenkins CLI --username/--password options #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 9, 2017

Conversation

samrocketman
Copy link
Member

Here's an example:

java -jar jenkins-cli.jar -s http://localhost:8080 -noKeyAuth who-am-i --username samrocketman --password-file ./personal-access-token

Unfortunately, Jenkins core prevents Jenkins CLI LoginCommand from working correctly because it only stores the Username and mishandles creating the authentication token. This is a bug in core.

@samrocketman
Copy link
Member Author

@i386 any idea why my Jenkins builds are getting out of memory errors like https://jenkins.ci.cloudbees.com/job/plugins/job/github-oauth-plugin/332/console ?

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 95.752 sec - in InjectedTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 107.265 sec - in org.jenkinsci.plugins.GithubSecurityRealmTest
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"

@samrocketman
Copy link
Member Author

samrocketman commented Feb 26, 2017

More out of memory woes. -> https://jenkins.ci.cloudbees.com/job/plugins/job/github-oauth-plugin/335/console

Builds just fine locally for me.

@samrocketman samrocketman force-pushed the jenkins-cli-token branch 2 times, most recently from d9f6ee0 to 3f64c19 Compare February 27, 2017 06:03
@samrocketman
Copy link
Member Author

Controlled the memory issue by adding .mvn/jvm.config and modifying src/test/java/org/jenkinsci/plugins/GithubSecurityRealmTest.java.

options.

Here's an example:

    java -jar jenkins-cli.jar -s http://localhost:8080 -noKeyAuth who-am-i \
      --username samrocketman --password-file ./personal-access-token

Unfortunately, Jenkins core prevents Jenkins CLI LoginCommand from
working correctly because it only stores the Username and mishandles
creating the authentication token.  This is a [bug in core][1].

[1]: https://github.com/jenkinsci/jenkins/blob/jenkins-2.47/core/src/main/java/hudson/cli/ClientAuthenticationCache.java#L65-L75
Copy link
Member

@docwhat docwhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@samrocketman samrocketman merged commit 3eeba9c into master Mar 9, 2017
@samrocketman samrocketman deleted the jenkins-cli-token branch March 9, 2017 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants