<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jenkins CLI Guide Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/jenkins-cli-guide/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/jenkins-cli-guide/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 27 Feb 2021 09:52:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Know About Jenkins CLI &#124; Jenkins CLI Guide</title>
		<link>https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli/</link>
					<comments>https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Mon, 10 Feb 2014 04:16:10 +0000</pubDate>
				<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[About Jenkins CLI]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Jenkins CLI]]></category>
		<category><![CDATA[Jenkins CLI Guide]]></category>
		<category><![CDATA[Jenkins CLI Instructions]]></category>
		<category><![CDATA[Jenkins CLI Reference]]></category>
		<category><![CDATA[Jenkins CLI Tutorial]]></category>
		<category><![CDATA[Jenkins Command line]]></category>
		<category><![CDATA[Understand Jenkins CLI]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2014/02/10/know-about-jenkins-cli/</guid>

					<description><![CDATA[<p>Running CLI java -jar jenkins-cli.jar [-s JENKINS_URL] command [options&#8230;] [arguments&#8230;] Getting help java -jar jenkins-cli.jar -s yourserver.com help [command] How [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli/">Know About Jenkins CLI | Jenkins CLI Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-3748 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/02/jenkins-cli.png" alt="jenkins-cli" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/02/jenkins-cli.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/02/jenkins-cli-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p><strong>Running CLI</strong><br />
java -jar jenkins-cli.jar [-s JENKINS_URL] command [options&#8230;] [arguments&#8230;]</p>
<p><strong>Getting help</strong><br />
java -jar jenkins-cli.jar -s yourserver.com help [command]</p>
<p><strong>How to download jenkins-cli.jar?</strong><br />
The best place to download the Jenkins CLI jar is from your own Jenkins server. This means you’ll have the matching CLI version. Visit the /cli endpoint, such as http://yourserver.com/cli, and it will give you a link to download the jar (the /jnlpJars/jenkins-cli.jar endpoint). Download that jar.</p>
<p><strong>Running commands against a secure Jenkins (basic auth or ssh keys)</strong></p>
<p>If your Jenkins is secured, and it probably is so that you control who can create jobs, run jobs, view results, then the command above may fail and ask for credentials.<br />
You have two options: provide &#8211;username &amp; &#8211;password options to every command or provide -i option and provide the path to the ssh private key that matches the public key you provided to your user account.<br />
For example:</p>
<p>$ java -jar jenkins-cli.jar -s http://myjenkins help &#8211;username me &#8211;password mypassword<br />
$ java -jar jenkins-cli.jar -s http://myjenkins help -i ~/.ssh/id_rsa</p>
<p><strong>Passing parameters when triggering a job build</strong><br />
To pass those same parameters via the CLI? You use the -p key=value flag for each parameter you want to pass.</p>
<p>So our finished product might look like:</p>
<p>$ java -jar jenkins-cli.jar -s http://myjenkins build &#8216;Deploy XYZ App&#8217; -i ~/.ssh/id_rsa -s -v -p target_env=api.cloudfoundry.com -p branch=master</p>
<p>How to get all commands for Jenkins CLI-<br />
Run &gt; <a href="http://yourserver.com/cli">http://yourserver.com/cli</a></p>
<p><strong>java -jar <a href="http://fmsscm.corp.intuit.net/qbo-qa/jnlpJars/jenkins-cli.jar">jenkins-cli.jar</a> -s http://fmsscm.corp.intuit.net/qbo-qa/ help</strong></p>
<h2>Available Commands</h2>
<ul type="disc">
<li><strong>build</strong>: Builds a job, and optionally waits until its completion.</li>
<li><strong>cancel-quiet-down</strong>: Cancel the effect of the &#8220;quiet-down&#8221; command.</li>
<li><strong>clear-queue</strong>: Clears the build queue</li>
<li><strong>connect-node</strong>: Reconnect to a node</li>
<li><strong>console</strong>: Retrieves console output of a build</li>
<li><strong>copy-job</strong>: Copies a job.</li>
<li><strong>create-job</strong>: Creates a new job by reading stdin as a configuration XML file.</li>
<li><strong>create-node</strong>: Creates a new node by reading stdin as a XML configuration.</li>
<li><strong>delete-builds</strong>: Deletes build record(s).</li>
<li><strong>delete-job</strong>: Deletes a job</li>
<li><strong>delete-node</strong>: Deletes a node</li>
<li><strong>disable-job</strong>: Disables a job</li>
<li><strong>disconnect-node</strong>: Disconnects from a node</li>
<li><strong>enable-job</strong>: Enables a job</li>
<li><strong>get-job</strong>: Dumps the job definition XML to stdout</li>
<li><strong>get-node</strong>: Dumps the node definition XML to stdout</li>
<li><strong>groovy</strong>: Executes the specified Groovy script.</li>
<li><strong>groovysh</strong>: Runs an interactive groovy shell.</li>
<li><strong>help</strong>: Lists all the available commands.</li>
<li><strong>install-plugin</strong>: Installs a plugin either from a file, an URL, or from update center.</li>
<li><strong>install-tool</strong>: Performs automatic tool installation, and print its location to stdout. Can be only called from inside a build.</li>
<li><strong>keep-build</strong>: Mark the build to keep the build forever.</li>
<li><strong>list-changes</strong>: Dumps the changelog for the specified build(s).</li>
<li><strong>list-jobs</strong>: Lists all jobs in a specific view or item group.</li>
<li><strong>list-plugins</strong>: Outputs a list of installed plugins.</li>
<li><strong>login</strong>: Saves the current credential to allow future commands to run without explicit credential information.</li>
<li><strong>logout</strong>: Deletes the credential stored with the login command.</li>
<li><strong>mail</strong>: Reads stdin and sends that out as an e-mail.</li>
<li><strong>offline-node</strong>: Stop using a node for performing builds temporarily, until the next &#8220;online-node&#8221; command.</li>
<li><strong>online-node</strong>: Resume using a node for performing builds, to cancel out the earlier &#8220;offline-node&#8221; command.</li>
<li><strong>quiet-down</strong>: Quiet down Jenkins, in preparation for a restart. Don’t start any builds.</li>
<li><strong>reload-configuration</strong>: Discard all the loaded data in memory and reload everything from file system. Useful when you modified config files directly on disk.</li>
<li><strong>restart</strong>: Restart Jenkins</li>
<li><strong>safe-restart</strong>: Safely restart Jenkins</li>
<li><strong>safe-shutdown</strong>: Puts Jenkins into the quiet mode, wait for existing builds to be completed, and then shut down Jenkins.</li>
<li><strong>session-id</strong>: Outputs the session ID, which changes every time Jenkins restarts</li>
<li><strong>set-build-description</strong>: Sets the description of a build.</li>
<li><strong>set-build-display-name</strong>: Sets the displayName of a build</li>
<li><strong>set-build-parameter</strong>: Update/set the build parameter of the current build in progress</li>
<li><strong>set-build-result</strong>: Sets the result of the current build. Works only if invoked from within a build.</li>
<li><strong>set-external-build-result</strong>: Set external monitor job result.</li>
<li><strong>set-next-build-number</strong>: Set build number to be used for next build.</li>
<li><strong>shutdown</strong>: Immediately shuts down Jenkins server</li>
<li><strong>update-job</strong>: Updates the job definition XML from stdin. The opposite of the get-job command</li>
<li><strong>update-node</strong>: Updates the node definition XML from stdin. The opposite of the get-node command</li>
<li><strong>version</strong>: Outputs the current version.</li>
<li><strong>wait-node-offline</strong>: Wait for a node to become offline</li>
<li><strong>wait-node-online</strong>: Wait for a node to become online</li>
<li><strong>who-am-i</strong>: Reports your credential and permissions</li>
</ul>
<p><strong>Reference –</strong><br />
<a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI">https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI</a><br />
<a href="http://stackoverflow.com/questions/18199355/jenkins-cli-authentication">http://stackoverflow.com/questions/18199355/jenkins-cli-authentication</a><br />
<a href="http://stackoverflow.com/questions/16617232/jenkins-cli-public-key-authentication-where-to-put-my-public-key-in-jenkins">http://stackoverflow.com/questions/16617232/jenkins-cli-public-key-authentication-where-to-put-my-public-key-in-jenkins</a></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli/">Know About Jenkins CLI | Jenkins CLI Guide</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Understand Jenkins CLI &#124; Jenkins CLI Reference</title>
		<link>https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli-2/</link>
					<comments>https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli-2/#respond</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Mon, 10 Feb 2014 04:16:10 +0000</pubDate>
				<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[About Jenkins CLI]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[Jenkins CLI]]></category>
		<category><![CDATA[Jenkins CLI Guide]]></category>
		<category><![CDATA[Jenkins CLI Instructions]]></category>
		<category><![CDATA[Jenkins CLI Reference]]></category>
		<category><![CDATA[Jenkins CLI Tutorial]]></category>
		<category><![CDATA[Jenkins Command line]]></category>
		<category><![CDATA[Understand Jenkins CLI]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2014/02/10/know-about-jenkins-cli-2/</guid>

					<description><![CDATA[<p>Running CLI java -jar jenkins-cli.jar [-s JENKINS_URL] command [options&#8230;] [arguments&#8230;] Getting help java -jar jenkins-cli.jar -s yourserver.com help [command] How [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli-2/">Understand Jenkins CLI | Jenkins CLI Reference</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="aligncenter wp-image-3751 size-full" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/02/jenkins-cli-1.png" alt="jenkins-cli" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/02/jenkins-cli-1.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2014/02/jenkins-cli-1-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p><strong>Running CLI</strong><br />
java -jar jenkins-cli.jar [-s JENKINS_URL] command [options&#8230;] [arguments&#8230;]</p>
<p><strong>Getting help</strong><br />
java -jar jenkins-cli.jar -s yourserver.com help [command]</p>
<p><strong>How to download jenkins-cli.jar?</strong><br />
The best place to download the Jenkins CLI jar is from your own Jenkins server. This means you’ll have the matching CLI version. Visit the /cli endpoint, such as http://yourserver.com/cli, and it will give you a link to download the jar (the /jnlpJars/jenkins-cli.jar endpoint). Download that jar.</p>
<p><strong>Running commands against a secure Jenkins (basic auth or ssh keys)</strong></p>
<p>If your Jenkins is secured, and it probably is so that you control who can create jobs, run jobs, view results, then the command above may fail and ask for credentials.<br />
You have two options: provide &#8211;username &amp; &#8211;password options to every command or provide -i option and provide the path to the ssh private key that matches the public key you provided to your user account.<br />
For example:</p>
<p>$ java -jar jenkins-cli.jar -s http://myjenkins help &#8211;username me &#8211;password mypassword<br />
$ java -jar jenkins-cli.jar -s http://myjenkins help -i ~/.ssh/id_rsa</p>
<p><strong>Passing parameters when triggering a job build</strong><br />
To pass those same parameters via the CLI? You use the -p key=value flag for each parameter you want to pass.</p>
<p>So our finished product might look like:</p>
<p>$ java -jar jenkins-cli.jar -s http://myjenkins build &#8216;Deploy XYZ App&#8217; -i ~/.ssh/id_rsa -s -v -p target_env=api.cloudfoundry.com -p branch=master</p>
<p>How to get all commands for Jenkins CLI-<br />
Run &gt; <a href="http://yourserver.com/cli">http://yourserver.com/cli</a></p>
<p><strong>java -jar <a href="http://fmsscm.corp.intuit.net/qbo-qa/jnlpJars/jenkins-cli.jar">jenkins-cli.jar</a> -s http://fmsscm.corp.intuit.net/qbo-qa/ help</strong></p>
<h2>Available Commands</h2>
<ul type="disc">
<li><strong>build</strong>: Builds a job, and optionally waits until its completion.</li>
<li><strong>cancel-quiet-down</strong>: Cancel the effect of the &#8220;quiet-down&#8221; command.</li>
<li><strong>clear-queue</strong>: Clears the build queue</li>
<li><strong>connect-node</strong>: Reconnect to a node</li>
<li><strong>console</strong>: Retrieves console output of a build</li>
<li><strong>copy-job</strong>: Copies a job.</li>
<li><strong>create-job</strong>: Creates a new job by reading stdin as a configuration XML file.</li>
<li><strong>create-node</strong>: Creates a new node by reading stdin as a XML configuration.</li>
<li><strong>delete-builds</strong>: Deletes build record(s).</li>
<li><strong>delete-job</strong>: Deletes a job</li>
<li><strong>delete-node</strong>: Deletes a node</li>
<li><strong>disable-job</strong>: Disables a job</li>
<li><strong>disconnect-node</strong>: Disconnects from a node</li>
<li><strong>enable-job</strong>: Enables a job</li>
<li><strong>get-job</strong>: Dumps the job definition XML to stdout</li>
<li><strong>get-node</strong>: Dumps the node definition XML to stdout</li>
<li><strong>groovy</strong>: Executes the specified Groovy script.</li>
<li><strong>groovysh</strong>: Runs an interactive groovy shell.</li>
<li><strong>help</strong>: Lists all the available commands.</li>
<li><strong>install-plugin</strong>: Installs a plugin either from a file, an URL, or from update center.</li>
<li><strong>install-tool</strong>: Performs automatic tool installation, and print its location to stdout. Can be only called from inside a build.</li>
<li><strong>keep-build</strong>: Mark the build to keep the build forever.</li>
<li><strong>list-changes</strong>: Dumps the changelog for the specified build(s).</li>
<li><strong>list-jobs</strong>: Lists all jobs in a specific view or item group.</li>
<li><strong>list-plugins</strong>: Outputs a list of installed plugins.</li>
<li><strong>login</strong>: Saves the current credential to allow future commands to run without explicit credential information.</li>
<li><strong>logout</strong>: Deletes the credential stored with the login command.</li>
<li><strong>mail</strong>: Reads stdin and sends that out as an e-mail.</li>
<li><strong>offline-node</strong>: Stop using a node for performing builds temporarily, until the next &#8220;online-node&#8221; command.</li>
<li><strong>online-node</strong>: Resume using a node for performing builds, to cancel out the earlier &#8220;offline-node&#8221; command.</li>
<li><strong>quiet-down</strong>: Quiet down Jenkins, in preparation for a restart. Don’t start any builds.</li>
<li><strong>reload-configuration</strong>: Discard all the loaded data in memory and reload everything from file system. Useful when you modified config files directly on disk.</li>
<li><strong>restart</strong>: Restart Jenkins</li>
<li><strong>safe-restart</strong>: Safely restart Jenkins</li>
<li><strong>safe-shutdown</strong>: Puts Jenkins into the quiet mode, wait for existing builds to be completed, and then shut down Jenkins.</li>
<li><strong>session-id</strong>: Outputs the session ID, which changes every time Jenkins restarts</li>
<li><strong>set-build-description</strong>: Sets the description of a build.</li>
<li><strong>set-build-display-name</strong>: Sets the displayName of a build</li>
<li><strong>set-build-parameter</strong>: Update/set the build parameter of the current build in progress</li>
<li><strong>set-build-result</strong>: Sets the result of the current build. Works only if invoked from within a build.</li>
<li><strong>set-external-build-result</strong>: Set external monitor job result.</li>
<li><strong>set-next-build-number</strong>: Set build number to be used for next build.</li>
<li><strong>shutdown</strong>: Immediately shuts down Jenkins server</li>
<li><strong>update-job</strong>: Updates the job definition XML from stdin. The opposite of the get-job command</li>
<li><strong>update-node</strong>: Updates the node definition XML from stdin. The opposite of the get-node command</li>
<li><strong>version</strong>: Outputs the current version.</li>
<li><strong>wait-node-offline</strong>: Wait for a node to become offline</li>
<li><strong>wait-node-online</strong>: Wait for a node to become online</li>
<li><strong>who-am-i</strong>: Reports your credential and permissions</li>
</ul>
<p><strong>Reference –</strong><br />
<a href="https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI">https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI</a><br />
<a href="http://stackoverflow.com/questions/18199355/jenkins-cli-authentication">http://stackoverflow.com/questions/18199355/jenkins-cli-authentication</a><br />
<a href="http://stackoverflow.com/questions/16617232/jenkins-cli-public-key-authentication-where-to-put-my-public-key-in-jenkins">http://stackoverflow.com/questions/16617232/jenkins-cli-public-key-authentication-where-to-put-my-public-key-in-jenkins</a></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli-2/">Understand Jenkins CLI | Jenkins CLI Reference</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/know-about-jenkins-cli-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
