{"id":516,"date":"2024-11-05T00:51:58","date_gmt":"2024-11-04T16:51:58","guid":{"rendered":"http:\/\/www.wengdao.net\/?p=516"},"modified":"2024-11-05T00:53:14","modified_gmt":"2024-11-04T16:53:14","slug":"jenkins-%e8%bf%9c%e7%a8%8b%e6%9e%84%e5%bb%ba","status":"publish","type":"post","link":"https:\/\/jiandao.zliby.com\/?p=516","title":{"rendered":"Jenkins \u8fdc\u7a0b\u6784\u5efa"},"content":{"rendered":"<h3>\u672c\u5730 api \u811a\u672c\u8fdc\u7a0b\u8c03\u7528Jenkins\u6784\u5efa<\/h3>\n<p>Jenkins \u652f\u6301API\u547d\u4ee4\u8c03\u7528\uff0c\u90a3\u4e48\u5728\u4f60\u672c\u5730\u6709\u547d\u4ee4\u884c\u73af\u5883\uff0c\u5c31\u80fd\u76f4\u63a5\u64cd\u4f5c Jenkins \u6784\u5efa\uff0c\u7ed3\u5408\u4e0a\u9762\u7684git bash \u547d\u4ee4\u7ec8\u7aef\uff0c\u5c06\u811a\u672c\u5199\u5165git \u81ea\u5b9a\u4e49\u811a\u672c\u4e2d\uff0c\u518d\u5173\u8054\u522b\u4eba\u652f\u6301\uff0c\u90a3\u4e48\u4f60\u5c31\u80fd \u8f93\u5165\u4e00\u4e2a \u6784\u5efa \u6307\u4ee4\uff0c\u5c31\u80fd\u5b9e\u73b0Jenkins\u8fdc\u7a0b\u6784\u5efa \u3002<\/p>\n<pre><code class=\"prettyprint\" >Replace with your Jenkins URL and admin credentials\nSERVER=&quot;http:\/\/localhost:8080&quot;\nFile where web session cookie is saved\n\nCOOKIEJAR=&quot;$(mktemp)&quot;\nCRUMB=$(curl -u &quot;admin:admin&quot; --cookie-jar &quot;$COOKIEJAR&quot; &quot;$SERVER\/crumbIssuer\/api\/xml?xpath=concat(\/\/crumbRequestField,%22:%22,\/\/crumb)&quot;)\ncurl -X POST -u &quot;admin:admin&quot; --cookie &quot;$COOKIEJAR&quot; -H &quot;$CRUMB&quot; &quot;$SERVER&quot;\/job\/someJob\/build<\/code><\/pre>\n<p>\u6765\u6e90\uff1a<a href=\"https:\/\/support.cloudbees.com\/hc\/en-us\/articles\/219257077-CSRF-Protection-Explained\">https:\/\/support.cloudbees.com\/hc\/en-us\/articles\/219257077-CSRF-Protection-Explained<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u5730 api \u811a\u672c\u8fdc\u7a0b\u8c03\u7528Jenkins\u6784\u5efa Jenkins \u652f\u6301API\u547d\u4ee4\u8c03\u7528\uff0c\u90a3\u4e48\u5728\u4f60\u672c\u5730\u6709\u547d\u4ee4\u884c\u73af\u5883\uff0c\u5c31 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=\/wp\/v2\/posts\/516"}],"collection":[{"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=516"}],"version-history":[{"count":2,"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=\/wp\/v2\/posts\/516\/revisions"}],"predecessor-version":[{"id":518,"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=\/wp\/v2\/posts\/516\/revisions\/518"}],"wp:attachment":[{"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jiandao.zliby.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}