{"id":815,"date":"2023-03-03T22:17:58","date_gmt":"2023-03-03T14:17:58","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=815"},"modified":"2023-03-03T22:18:12","modified_gmt":"2023-03-03T14:18:12","slug":"centos-deploy-jenkins","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/03\/centos-deploy-jenkins\/","title":{"rendered":"CentOS\u4e0b\u90e8\u7f72Jenkins"},"content":{"rendered":"<h2>Jenkins\u7b80\u4ecb<\/h2>\n<p>Jenkins\u662f\u4e00\u4e2a\u5f00\u6e90\u8f6f\u4ef6\u9879\u76ee\uff0c\u662f\u57fa\u4e8eJava\u5f00\u53d1\u7684\u4e00\u79cd\u6301\u7eed\u96c6\u6210\u5de5\u5177\uff0c\u7528\u4e8e\u76d1\u63a7\u6301\u7eed\u91cd\u590d\u7684\u5de5\u4f5c\uff0c\u65e8\u5728\u63d0\u4f9b\u4e00\u4e2a\u5f00\u653e\u6613\u7528\u7684\u8f6f\u4ef6\u5e73\u53f0\uff0c\u4f7f\u8f6f\u4ef6\u7684\u6301\u7eed\u96c6\u6210\u53d8\u6210\u53ef\u80fd\u3002<\/p>\n<p><!-- more --><\/p>\n<p><strong>Jenkins\u529f\u80fd\u5305\u62ec<\/strong>\uff1a<\/p>\n<ul>\n<li>1\u3001\u6301\u7eed\u7684\u8f6f\u4ef6\u7248\u672c\u53d1\u5e03\/\u6d4b\u8bd5\u9879\u76ee<\/li>\n<li>2\u3001\u76d1\u63a7\u5916\u90e8\u8c03\u7528\u6267\u884c\u7684\u5de5\u4f5c<\/li>\n<\/ul>\n<p>\u5b98\u65b9\u7f51\u7ad9\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/jenkins.io\/\">https:\/\/jenkins.io\/<\/a><br \/>\n\u5b89\u88c5\u6307\u5357\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/jenkins.io\/doc\/pipeline\/tour\/getting-started\/\">https:\/\/jenkins.io\/doc\/pipeline\/tour\/getting-started\/<\/a><br \/>\nwar\u5305\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/mirrors.jenkins.io\/war-stable\/latest\/jenkins.war\">http:\/\/mirrors.jenkins.io\/war-stable\/latest\/jenkins.war<\/a><\/p>\n<p><strong>Jenkins\u9ed8\u8ba4\u914d\u7f6e<\/strong>\uff1a<\/p>\n<p>Jenkins\u4e3b\u76ee\u5f55\uff1a~\/.jenkins\/<br \/>\n\u521d\u59cb\u5bc6\u7801\u6587\u4ef6\uff1a~\/.jenkins\/secrets\/initialAdminPassword<br \/>\n\u63d2\u4ef6\u76ee\u5f55\uff08\u53ef\u4ee5\u9009\u62e9\u5b89\u88c5\u6240\u6709\u63a8\u8350\u63d2\u4ef6\uff09\uff1a~\/.jenkins\/plugins\/<\/p>\n<p><strong>\u624b\u52a8\u5728\u7ebf\u5b89\u88c5\u5e38\u7528\u63d2\u4ef6\uff08\u5efa\u8bae\u5b89\u88c5\u6240\u6709\u63a8\u8350\u63d2\u4ef6\uff09<\/strong>\uff1a<\/p>\n<ul>\n<li>Maven Integration<\/li>\n<li>Subversion Plug-in<\/li>\n<li>Git plugin<\/li>\n<li>Maven Integration plugin<\/li>\n<li>Gradle Plugin<\/li>\n<\/ul>\n<p><strong>\u90e8\u7f72\u65e5\u5fd7\u67e5\u770b<\/strong>\uff1a<\/p>\n<pre><code class=\"language-shell\"># tail -f \/usr\/local\/tomcat85\/logs\/catalina.out<\/code><\/pre>\n<h2>\u4fee\u6539Jenkins\u4e3b\u76ee\u5f55<\/h2>\n<p>\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6eJENKINS_HOME\u73af\u5883\u53d8\u91cf\u6765\u4fee\u6539\uff0c\u4f8b\u5982\uff1aJENKINS_HOME=\/data\/Jenkins\uff0c\u7136\u540e\u91cd\u65b0\u542f\u52a8Jenkins\u3002<\/p>\n<blockquote>\n<p>\u6ce8\u610f\uff1a\u6700\u597d\u5728\u90e8\u7f72war\u5305\u4e4b\u524d\u8bbe\u7f6eJENKINS_HOME\u73af\u5883\u53d8\u91cf\u3002\u5728Jenkins\u8fd0\u884c\u65f6\u662f\u4e0d\u80fd\u66f4\u6539\u7684\uff0c\u8bf7\u5148\u5c06Jenkins\u505c\u6b62\u8fd0\u884c\uff0c\u5728\u7ad9\u70b9\u9762\u677f [\u7cfb\u7edf\u7ba1\u7406] -&gt; [\u51c6\u5907\u5173\u673a] -&gt; \u63d0\u793a&quot;Jenkins \u5373\u5c06\u5173\u95ed&quot;<\/p>\n<\/blockquote>\n<pre><code class=\"language-shell\"># vim \/etc\/profile\n\nexport JENKINS_HOME=\/data\/Jenkins\n\n# source \/etc\/profile\n# echo $JENKINS_HOME\n# \/usr\/local\/tomcat85\/bin\/shutdown.sh\n# mkdir \/data\/Jenkins\n# cp -R \/root\/.jenkins\/* \/data\/Jenkins\n# \/usr\/local\/tomcat85\/bin\/startup.sh<\/code><\/pre>\n<h2>Tomcat\u914d\u7f6e\u865a\u62df\u4e3b\u673a\u5b9e\u73b0\u57df\u540d\u8bbf\u95ee<\/h2>\n<pre><code class=\"language-shell\"># mkdir \/data\/www\/Jenkins\n# chown www -R \/data\/www\/Jenkins\n# vim \/usr\/local\/tomcat85\/conf\/server.xml\n# \/usr\/local\/tomcat85\/bin\/startup.sh<\/code><\/pre>\n<pre><code class=\"language-xml\">&lt;Host name=&quot;jk.yezhou.me&quot; appBase=&quot;\/data\/www\/Jenkins&quot;\n    unpackWARs=&quot;true&quot; autoDeploy=&quot;true&quot;\n    xmlValidation=&quot;false&quot; xmlNamespaceAware=&quot;false&quot; &gt;\n    &lt;Context docBase=&quot;&quot; path=&quot;\/&quot; reloadable=&quot;true&quot; crossContext=&quot;true&quot; &gt;&lt;\/Context&gt;\n    &lt;!--Context docBase=&quot;admin&quot; path=&quot;\/admin\/&quot; reloadable=&quot;true&quot; crossContext=&quot;true&quot; &gt;&lt;\/Context--&gt;\n&lt;\/Host&gt;<\/code><\/pre>\n<p>\u8bbf\u95ee\u5730\u5740\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/jk.yezhou.me:8080\/\">http:\/\/jk.yezhou.me:8080\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jenkins\u7b80\u4ecb Jenkins\u662f\u4e00\u4e2a\u5f00\u6e90\u8f6f\u4ef6\u9879\u76ee\uff0c\u662f\u57fa\u4e8eJava\u5f00\u53d1\u7684\u4e00\u79cd\u6301\u7eed\u96c6\u6210\u5de5\u5177\uff0c\u7528\u4e8e\u76d1\u63a7\u6301\u7eed\u91cd\u590d\u7684 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[91],"tags":[92],"class_list":["post-815","post","type-post","status-publish","format-standard","hentry","category-ci-cd","tag-jenkins"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/815","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=815"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/815\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}