Skip to content
Albert Tregnaghi edited this page Oct 2, 2018 · 4 revisions

Jenkins CLI setup

How can I setup my Jenkins Server URL

Go to the preference page of Jenkins Editor and define Jenkins URL (optional).

The field should be filled with protocol://hostname:port - e.g. https://mytrustful.jenkins.dev.intranet:8080 When you leave the field empty the default value will be used. When you have defined JENKINS_URL env entry this will be the default value otherwise http://localhost:8080 will be used (as described below the field in next picture from preference screenshot)

How can I setup my credentials?

Currently the editor does support only anonymous `or login by `username + apiToken. # API-Token To setup credentials for Jenkins CLI open the preference page and press the "Credentials…​" button as shown in next picture. Setup user name and API-Token. The data will be stored secured by eclipse.

Jenkins CLI Preferences for API-Token

Get your API-Token

To get your api token for your user open the URL:` JENKINS_URL/user/$userName/configure`

As an example: `http://localhost:8080/user/albert/configure`

Test connection

There exists a Test connection button where you can check server connection works. When pressed a valid linter evaluation is triggered. If not possible an error will be shown, otherwise an information about success.

Self signed certificates / Problems with HTTPS

When you use `HTTPS `and your Jenkins got only a self signed certificate you will have problems with connection because your `JRE `does not trust the certificate.

If this happens you can (from Version 1.1.0) now disable certifcate check inside preferences too. But be careful with this option - use it only when you have no other way to trust your own servers! Normally you should import the certificates into your JRE or JDK instead of turning on this option!

Howto use other version of jenkins CLI?

Jenkins-Editor comes with an integrated jenkins-cli.jar (please look into README.md for version info). When you have issues with connections etc. you can use a dedicated version provided by your Jenkins server.

As described at https://jenkins.io/doc/book/managing/cli/#downloading-the-client you can download the cli client directly from your running Jenkins Server. And this CLI version must always work…​

Download your CLI at https://JENKINS_URL/jnlpJars/jenkins-cli.jar und use it inside Jenkins Editor Preferences in text field labeled with Path to jenkins-cli.jar (optional) by using the Browse…​ button or entering the path directly.

Jenkins CLI Preferences for API-Token

Howto connect to a jenkins behind proxy?

Just open preferences and enable the usage of eclipse proxy settings, so it eclipse proxy preferences are reused for jenkins editor as well. Some more details can be found in Issue 18.

preference page showing proxy settings