{"id":1337,"date":"2024-01-10T23:32:48","date_gmt":"2024-01-10T18:02:48","guid":{"rendered":"https:\/\/www.openwriteup.com\/?page_id=1337"},"modified":"2024-01-10T23:32:48","modified_gmt":"2024-01-10T18:02:48","slug":"pipeline-for-postman-collection","status":"publish","type":"page","link":"https:\/\/www.openwriteup.com\/?page_id=1337","title":{"rendered":"Pipeline for postman collection"},"content":{"rendered":"<p>Check jenkins users is part of sudoers file<\/p>\n<p>jenkins ALL=(ALL) NOPASSWD:ALL<\/p>\n<p>Create a pipeline job<\/p>\n<p>&nbsp;<\/p>\n<pre>pipeline {\r\nagent any\r\n\r\nstages {\r\nstage('Checkout') {\r\nsteps {\r\n\/\/ Checkout your Git repository\r\ncheckout scmGit(branches: [[name: '*\/main']], extensions: [], userRemoteConfigs: [[url:\r\n'https:\/\/github.com\/amitopenwriteup\/repojenkins.git']])\r\n}\r\n}\r\n\r\nstage('Install npm') {\r\nsteps {\r\n\/\/ Install Newman globally\r\nsh 'sudo apt-get install -y npm'\r\n}\r\n}\r\n\r\nstage('Install Newman') {\r\nsteps {\r\n\/\/ Install specific versions of Newman and Commander\r\nsh 'sudo npm install -g newman@5.2.3' \/\/ Replace with the actual version\r\nsh 'sudo npm install -g commander@2.20.0' \/\/ Replace with the actual version\r\n}\r\n}\r\n\r\nstage('Run Postman Collection') {\r\nsteps {\r\n\/\/ Run your Postman collection using Newman\r\nsh 'sudo newman run collections.json'\r\n}\r\n}\r\n}\r\n}<\/pre>\n<p>Newman is a command-line tool that allows you to run Postman collections directly from the command line.<\/p>\n<p>Postman collections are a way to organize and group together a set of API requests, along with their associated tests, pre-request scripts, and other related information.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Check jenkins users is part of sudoers file jenkins ALL=(ALL) NOPASSWD:ALL Create a pipeline job &nbsp; pipeline { agent any stages { stage(&#8216;Checkout&#8217;) { steps { \/\/ Checkout your Git repository checkout scmGit(branches: [[name: &#8216;*\/main&#8217;]], extensions: [], userRemoteConfigs: [[url: &#8216;https:\/\/github.com\/amitopenwriteup\/repojenkins.git&#8217;]]) } } stage(&#8216;Install npm&#8217;) { steps { \/\/ Install Newman globally sh &#8216;sudo apt-get install [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_oct_exclude_from_cache":false,"footnotes":""},"class_list":["post-1337","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/pages\/1337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1337"}],"version-history":[{"count":1,"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/pages\/1337\/revisions"}],"predecessor-version":[{"id":1338,"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=\/wp\/v2\/pages\/1337\/revisions\/1338"}],"wp:attachment":[{"href":"https:\/\/www.openwriteup.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}