{"id":969,"date":"2014-09-19T22:51:00","date_gmt":"2014-09-19T14:51:00","guid":{"rendered":"http:\/\/ftp80491.host171.zhujiwu.cn\/?p=967"},"modified":"2014-09-19T22:51:00","modified_gmt":"2014-09-19T14:51:00","slug":"jenkins%e5%90%af%e5%8a%a8%e5%ae%88%e6%8a%a4%e8%bf%9b%e7%a8%8b%e5%90%8e%e5%8f%b0%e6%8c%81%e7%bb%ad%e8%bf%90%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/www.yeetrack.com\/?p=969","title":{"rendered":"Jenkins\u542f\u52a8\u5b88\u62a4\u8fdb\u7a0b\u540e\u53f0\u6301\u7eed\u8fd0\u884c"},"content":{"rendered":"<p style=\"color: #373737;\">\u5728\u4f7f\u7528jenkins\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u80fd\u6709\u8fd9\u6837\u7684\u9700\u6c42\uff0c\u5e0c\u671bjenkins\u542f\u52a8\u7684\u8fdb\u7a0b\u5728\u540e\u53f0\u6301\u7eed\u8fd0\u884c\uff0c\u4e0d\u963b\u585ejenkins\u7684\u6784\u5efa\u30021.136\u7248\u672c\u4e4b\u524d\u7684jenkins\u4e0d\u6ee1\u8db3\u8fd9\u79cd\u9700\u6c42\uff0c1.136\u4e4b\u540e\u7684\u7248\u672c\u652f\u6301\u3002<\/p>\n<h2>\u4e3a\u4ec0\u4e48jenkins\u7684\u8fdb\u7a0b\u662f\u963b\u585e\u7684?<\/h2>\n<p style=\"color: #373737;\">jenkins\u4e3b\u8fdb\u7a0b\u548c\u5b83\u6240\u542f\u52a8\u7684\u5b50\u8fdb\u7a0b\u901a\u8fc7stdin\u3001stdout\u3001stderr\u8fd9\u4e09\u4e2a\u7ba1\u9053\u76f8\u4e92\u8054\u7cfb\u3002\u4e5f\u56e0\u4e3a\u8fd9\u6837\uff0cjenkins\u53ef\u4ee5\u6253\u5370\u6240\u6709\u8fdb\u7a0b\u7684\u65e5\u5fd7\u3002\u5b50\u8fdb\u7a0b\u53ef\u80fd\u6253\u5370\u6d77\u91cf\u7684\u65e5\u5fd7\uff0c\u7136\u540e\u7ed3\u675f\uff0c\u4f46\u662fjenkins\u4e3b\u8fdb\u7a0b\u8981\u4fdd\u8bc1\u6240\u6709\u7684\u5b50\u8fdb\u7a0b\u901a\u9053\u5173\u95ed\u540e\uff0c\u624d\u80fd\u8ba4\u4e3a\u672c\u6b21build\u7ed3\u675f\u3002jenkins\u53ea\u6709\u7b49\u5230\u4e86EOF\uff0c\u624d\u4f1a\u7ed3\u675f\u3002<!--more--><span id=\"more-969\"><\/span><\/p>\n<p style=\"color: #373737;\">\u4e00\u4e2a\u8fdb\u7a0b\u7ed3\u675f\u540e\uff08\u65e0\u8bba\u4ec0\u4e48\u539f\u56e0\uff09\uff0c\u64cd\u4f5c\u7cfb\u7edf\u5c31\u4f1a\u5173\u95ed\u8fd9\u4e2a\u8fdb\u7a0b\u76f8\u5173\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\u3002\u6240\u4ee5\u5373\u4f7f\u8fdb\u7a0b\u6ca1\u6709\u5173\u95edstdin\u3001stderr\uff0cjenkins\u4e5f\u4f1a\u6536\u5230EOF\u3002<\/p>\n<p style=\"color: #373737;\">\u4e3b\u8fdb\u7a0b\u5f00\u542f\u5b50\u8fdb\u7a0b\uff0c\u5b50\u8fdb\u7a0b\u4f1a\u7ee7\u627f\u4e3b\u8fdb\u7a0b\u6240\u6709\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\uff0c\u5305\u62ecstdin\u3001stderr\u901a\u9053\u3002\u5982\u679c\u5b50\u8fdb\u7a0b\u9700\u8981\u6301\u7eed\u8fd0\u884c\uff08\u5b88\u62a4\u8fdb\u7a0b\uff09\u3002\u4e00\u65e6\u4e3b\u8fdb\u7a0b\u5fd8\u8bb0\u5173\u95ed\u5b50\u8fdb\u7a0b\uff0c\u90a3\u4e48jenkins\u5373\u4f7f\u5728\u4e3b\u8fdb\u7a0b\u7ed3\u675f\u540e\uff0c\u4e5f\u4e0d\u4f1a\u6536\u5230EOF\uff0c\u56e0\u4e3a\u5b50\u8fdb\u7a0b\u8fd8\u4fdd\u7559\u7740\u6240\u6709\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\u3002<\/p>\n<p style=\"color: #373737;\">\u4e00\u4e2a\u6b63\u5e38\u7684\u5b88\u62a4\u8fdb\u7a0b\u4f1a\u5173\u95ed\u5b83\u6240\u6709\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\uff0c\u6765\u907f\u514d\u4e0a\u8ff0\u60c5\u51b5\u3002\u4f46\u662f\u6709\u65f6\u5019\uff0c\u6211\u4eec\u5c31\u662f\u5e0c\u671bjenkins\u5f00\u542f\u5b50\u8fdb\u7a0b\u6301\u7eed\u8fd0\u884c\u3002<\/p>\n<h2>\u89e3\u51b3\u529e\u6cd5<\/h2>\n<h3 style=\"color: #373737;\">UNIX<\/h3>\n<p style=\"color: #373737;\">unix\u4e2d\u4f7f\u7528<code>daemonize<\/code>\u547d\u4ee4\uff0c\u5982\u679c\u673a\u5668\u4e0a\u6ca1\u6709\u6b64\u547d\u4ee4\uff0c\u53ef\u4ee5\u5b89\u88c5\u4e0b<a style=\"color: #11598f;\" href=\"http:\/\/software.clapper.org\/daemonize\/\">http:\/\/software.clapper.org\/daemonize\/<\/a>\u3002<\/p>\n<pre style=\"color: #373737;\"><code>daemonize -E BUILD_ID=dontKillMe -o some.log -c \/home\/User\/victor  \/home\/User\/victor\/test.sh\n<\/code><\/pre>\n<p style=\"color: #373737;\">-o :\u6307\u5b9a\u65e5\u5fd7\u6587\u4ef6\uff0c-c :\u547d\u4ee4\u6267\u884c\u524d\u5207\u6362\u5230\u8be5\u8def\u5f84\uff0c\u6700\u540e\u662f\u8981\u6267\u884c\u811a\u672c\u7684\u7edd\u5bf9\u8def\u5f84\u3002<\/p>\n<h2>windows<\/h2>\n<p style=\"color: #373737;\">windows\u4e2d\u53ef\u4ee5\u4f7f\u7528at\u548cSCHTASKS\u547d\u4ee4\u6765\u5b9e\u73b0\u540e\u53f0\u8fd0\u884c\u3002<\/p>\n<p style=\"color: #373737;\">\u5982\u679cjenkins\u4f7f\u7528\u7684\u662fant\u6784\u5efa\uff0c\u589e\u52a0\u4e0b\u9762\u7684\u4ee3\u7801\u5373\u53ef\uff08\u6267\u884cbat\u811a\u672c\uff09\uff1a<\/p>\n<pre style=\"color: #373737;\"><code>&lt;scriptdef name=\"get-next-minute\" language=\"beanshell\"&gt;\n    &lt;attribute name=\"property\" \/&gt;\n\n    date = new java.text.SimpleDateFormat(\"HH:mm\").format(new Date(System.currentTimeMillis() + 60000));\n    project.setProperty(attributes.get(\"property\"), date);\n&lt;\/scriptdef&gt;\n\n&lt;get-next-minute property=\"next-minute\" \/&gt;\n&lt;exec executable=\"at\"&gt;\n    &lt;arg value=\"${next-minute}\" \/&gt;\n    &lt;arg value=\"\/interactive\" \/&gt;\n    &lt;arg value=\"${jboss.home}\\bin\\run.bat\" \/&gt;\n&lt;\/exec&gt;\n<\/code><\/pre>\n<p style=\"color: #373737;\">\u4f7f\u7528ant\u6784\u5efa\uff0c\u6267\u884cjs\u811a\u672c\uff1a<\/p>\n<pre style=\"color: #373737;\"><code>    &lt;exec executable=\"cscript.exe\"&gt;\n    &lt;env key=\"ANTRUN_TITLE\" value=\"Title for Window\" \/&gt;  &lt;!-- optional --&gt;\n    &lt;env key=\"ANTRUN_OUTPUT\" value=\"output.log\" \/&gt;  &lt;!-- optional --&gt;\n    &lt;arg value=\"\/\/NoLogo\" \/&gt;\n    &lt;arg value=\"antRunAsync.js\" \/&gt;  &lt;!-- this script --&gt;\n    &lt;arg value=\"real executable\" \/&gt;\n    &lt;\/exec&gt;\n<\/code><\/pre>\n<p style=\"color: #373737;\">\u4f7f\u7528SCHTASKS\u547d\u4ee4\uff1a<\/p>\n<pre style=\"color: #373737;\"><code>C:\\&gt;SCHTASKS \/Create \/RU SYSTEM \/SC ONSTART \/TN Tomcat \/TR \"C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\bin\\startup.bat\"\n<\/code><\/pre>\n<p style=\"color: #373737;\">\u5982\u679c\u662f\u7528ant\u8c03\u7528\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u4ee3\u7801\uff1a<\/p>\n<pre style=\"color: #373737;\"><code>    &lt;exec executable=\"SCHTASKS\"&gt;\n        &lt;arg value=\"\/Run\"\/&gt;\n        &lt;arg value=\"\/TN\"\/&gt;\n        &lt;arg value=\"Tomcat\"\/&gt;\n    &lt;\/exec&gt;\n<\/code><\/pre>\n<p><code>\u00a0<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f7f\u7528jenkins\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u80fd\u6709\u8fd9\u6837\u7684\u9700\u6c42\uff0c\u5e0c\u671bjenkins\u542f\u52a8\u7684\u8fdb\u7a0b\u5728\u540e\u53f0\u6301\u7eed\u8fd0\u884c\uff0c\u4e0d\u963b\u585ejenkins\u7684\u6784\u5efa\u30021.136\u7248\u672c\u4e4b\u524d\u7684jenkins\u4e0d\u6ee1\u8db3\u8fd9\u79cd\u9700\u6c42\uff0c1.136\u4e4b\u540e\u7684\u7248\u672c\u652f\u6301\u3002 &#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[],"tags":[],"class_list":["post-969","post","type-post","status-publish","format-standard","hentry"],"views":8156,"_links":{"self":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=969"}],"version-history":[{"count":0,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=\/wp\/v2\/posts\/969\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=969"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yeetrack.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}