<?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 Command line Tutorial Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/jenkins-command-line-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/jenkins-command-line-tutorial/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Sat, 27 Feb 2021 09:51:14 +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>Jenkins Command line Reference for login and trigger a job</title>
		<link>https://www.scmgalaxy.com/tutorials/jenkins-command-line-reference-for-login-and-trigger-a-job/</link>
					<comments>https://www.scmgalaxy.com/tutorials/jenkins-command-line-reference-for-login-and-trigger-a-job/#comments</comments>
		
		<dc:creator><![CDATA[scmgalaxy K]]></dc:creator>
		<pubDate>Thu, 05 Feb 2015 00:00:00 +0000</pubDate>
				<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[How]]></category>
		<category><![CDATA[How to login in Jenkins]]></category>
		<category><![CDATA[How to trigger a job in Jenkins]]></category>
		<category><![CDATA[Jenkins Command line]]></category>
		<category><![CDATA[Jenkins Command line Guide]]></category>
		<category><![CDATA[Jenkins Command line Reference]]></category>
		<category><![CDATA[Jenkins Command line Tutorial]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[Login]]></category>
		<category><![CDATA[Login Jenkins]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Steps]]></category>
		<category><![CDATA[Trigger]]></category>
		<category><![CDATA[Ways]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/2015/02/05/jenkins-command-line-reference-for-login-and-trigger-a-job/</guid>

					<description><![CDATA[<p>Grep will return 0 while the build is running: $ curl http://myjenkins/job/myjob/lastBuild/api/json &#124; grep &#8211;color result\&#8221;:null $ echo $? Trigger [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/jenkins-command-line-reference-for-login-and-trigger-a-job/">Jenkins Command line Reference for login and trigger a job</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-3535 aligncenter" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2015/02/jenkins-command-line-refere.png" alt="jenkins-command-line-reference" width="600" height="400" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2015/02/jenkins-command-line-refere.png 600w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2015/02/jenkins-command-line-refere-300x200.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></p>
<p><b>Grep will return 0 while the build is running:</b></p>
<p>$ curl http://myjenkins/job/myjob/lastBuild/api/json | grep &#8211;color result\&#8221;:null</p>
<p>$ echo $?</p>
<p><strong>Trigger a Jenkins Job from command line</strong></p>
<p>$ wget http://yourserver/job/MyJobname/build?delay=0sec</p>
<p>$ wget -O &#8211; $HUDSON_URL/job/JOBNAME/build</p>
<p><strong>Trigger a Jenkins Job without authentication</strong></p>
<p>$ curl http://jenkins:8080/job/my%20job/build</p>
<p><strong>Trigger a Jenkins Job with authentication</strong></p>
<p>$ curl &#8211;user dbacher:$MY_API_TOKEN http://jenkins:8080/job/my%20job/build</p>
<p>$ curl &#8211;user &lt;your_jenkins_username&gt;:&lt;your_jenkins_API_key&gt; http://&lt;jenkins_server_url&gt;/job/&lt;your_jenkins_job_name&gt;/build</p>
<p><strong>Running commands against a secure Jenkins (basic auth or ssh keys)</strong></p>
<p>$ java -jar jenkins-cli.jar -s http://myjenkins help &#8211;username me &#8211;password mypassword</p>
<p>$ java -jar jenkins-cli.jar -s http://myjenkins help -i ~/.ssh/id_rsa</p>
<p><strong>Triggering a job build against a secure Jenkins (avoiding a 1.5 year old open bug!)</strong></p>
<p>$ java -jar jenkins-cli.jar -s http://myjenkins build &#8216;My Awesome Jenkins Job&#8217; -i ~/.ssh/id_rsa</p>
<p>$ java -jar jenkins-cli.jar -s http://myjenkins build &#8216;My Awesome Jenkins Job&#8217; -i ~/.ssh/id_rsa -s -v</p>
<p><strong>Passing parameters when triggering a job build</strong></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><strong>Reference</strong></p>
<p><a href="http://starkandwayne.com/articles/2013/04/12/jenkins-builds-from-cli/" target="_blank" rel="noopener">http://starkandwayne.com/articles/2013/04/12/jenkins-builds-from-cli/</a></p>
<p><a href="http://www.scmgalaxy.com/index.php?option=com_k2&amp;view=item&amp;id=890:ways-to-login-jenkins-using-command-line&amp;Itemid=120" target="_blank" rel="noopener">http://www.scmgalaxy.com/index.php?option=com_k2&amp;view=item&amp;id=890:ways-to-login-jenkins-using-command-line&amp;Itemid=120</a></p>
<p><strong>Appendix</strong></p>
<p>1. How to get your_jenkins_API_key?</p>
<ul>
<li>Login to your Jenkins.</li>
<li>Click on the username in the top right.</li>
<li>Click on Configure.</li>
<li>Click on ‘Show API Token’ button.</li>
<li>You got it.</li>
</ul>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/jenkins-command-line-reference-for-login-and-trigger-a-job/">Jenkins Command line Reference for login and trigger a job</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/jenkins-command-line-reference-for-login-and-trigger-a-job/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
