{"id":78407,"date":"2026-02-27T11:43:21","date_gmt":"2026-02-27T03:43:21","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/78407.html"},"modified":"2026-02-27T11:43:21","modified_gmt":"2026-02-27T03:43:21","slug":"cicd%e6%9c%8d%e5%8a%a1%e5%99%a8jenkins","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/78407.html","title":{"rendered":"CICD\u670d\u52a1\u5668jenkins"},"content":{"rendered":"<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Jenkins \u662f\u57fa\u4e8e Java \u5f00\u53d1\u7684\u4e00\u79cd\u5f00\u6e90\u7684CI&#xff08;Continuous integration\u6301\u7eed\u96c6\u6210&#xff09;&amp;CD (Continuous\u00a0Delivery\u6301\u7eed\u4ea4\u4ed8&#xff0c;Continuous Deployment\u6301\u7eed\u90e8\u7f72)\u5de5\u5177<\/p>\n<h2>\u4e00\u3001\u00a0Jenkins \u5b89\u88c5\u548c\u542f\u52a8<\/h2>\n<h3>&#xff08;\u4e00&#xff09;jenkins\u5b89\u88c5<\/h3>\n<h4>1.\u73af\u5883\u51c6\u5907<\/h4>\n<p>\u7528\u54ea\u4e2a\u7248\u672c\u7684java\u73af\u5883\u4ece\u5b98\u7f51\u770b&#xff1a;https:\/\/www.jenkins.io\/doc\/book\/platform-information\/support-policy-java\/<\/p>\n<p>apt update &amp;&amp; apt -y install openjdk-21-jdk <\/p>\n<p>\u4ece\u7f51\u4e0a\u4e0b\u8f7djenkins\u7a33\u5b9a\u7248\u7684\u5b89\u88c5\u5305\u540e&#xff0c;\u653e\u5230\u4e3b\u673a\u4e0a\u5b89\u88c5<\/p>\n<p>root&#064;ubuntu10:~  dpkg -i jenkins_2.541.1_all.deb  <\/p>\n<p>\u7136\u540e\u5c31\u53ef\u4ee5\u5728\u5ba2\u6237\u7aef\u8bbf\u95ee10.0.0.10:8080\u7aef\u53e3&#xff0c;\u6839\u636e\u63d0\u793a\u627e\u5230\u5bc6\u7801\u5e76\u8f93\u5165<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"513\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034312-69a112d0b9488.png\" width=\"1440\" \/><\/p>\n<p>\u8fdb\u5165\u540e\u53ef\u4ee5\u9009\u62e9\u81ea\u5df1\u9700\u8981\u7684\u63d2\u4ef6\u5b89\u88c5&#xff0c;\u4e00\u76f4\u4e0b\u4e00\u6b65<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"685\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034313-69a112d103ce9.png\" width=\"1554\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"798\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034313-69a112d17773a.png\" width=\"1679\" \/><\/p>\n<p>\u5b89\u88c5\u4e2d\u6587\u63d2\u4ef6<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"547\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034314-69a112d20ac5e.png\" width=\"1840\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"502\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034314-69a112d269a82.png\" width=\"1858\" \/><\/p>\n<p>\u4e0b\u8f7d\u4e0b\u6765\u7684\u5305\u9ed8\u8ba4\u5730\u5740\u5728&#xff1a;\/var\/lib\/jenkins\/plugins\/<\/p>\n<p>\u4e2d\u6587\u63d2\u4ef6\u9700\u8981\u91cd\u542f jenkins \u540e\u751f\u6548&#xff0c;\u53ef\u4ee5\u5728\u7ec8\u7aef<\/p>\n<p>systemctl restart jenkins.service<\/p>\n<p>\u4e5f\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u516510.0.0.10:8080\/restart<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"627\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034314-69a112d2c2535.png\" width=\"1474\" \/><\/p>\n<h4>2.\u5bc6\u7801\u627e\u56de<\/h4>\n<p>\u5148\u4e0b\u8f7djenkins.cli.jar\u6587\u4ef6,\u53ef\u4ee5\u6267\u884c\u4e0b\u9762\u64cd\u4f5c\u8fdb\u884c\u7ba1\u7406jenkins<\/p>\n<p>wget http:\/\/10.0.0.10:8080\/jnlpJars\/jenkins-cli.jar<\/p>\n<p>java -jar jenkins-cli.jar -s http:\/\/10.0.0.10:8080\/ help<br \/>\nERROR: You must authenticate to access this Jenkins.<br \/>\nJenkins CLI<br \/>\nUsage: java -jar jenkins-cli.jar [-s URL] command [opts&#8230;] args&#8230;<br \/>\nOptions:<br \/>\n -s URL              : the server URL (defaults to the JENKINS_URL env var)<br \/>\n -webSocket          : connect using WebSocket (the default; works well with most reverse proxies; requires Jetty)<br \/>\n -http               : use a pair of HTTP(S) connections rather than WebSocket<br \/>\n -ssh                : use SSH protocol rather than WebSocket (requires -user; SSH port must be open on server)<br \/>\n -i KEY              : SSH private key file used for authentication (for use with -ssh)<br \/>\n -noCertificateCheck : bypass HTTPS certificate check entirely. Use with caution<br \/>\n -noKeyAuth          : do not try to load the SSH authentication private key. Conflicts with -i<br \/>\n -user               : specify user (for use with -ssh; must have registered a public key)<br \/>\n -strictHostKey      : request strict host key checking (for use with -ssh)<br \/>\n -logger FINE        : enable detailed logging from the client<br \/>\n -auth [ USER:SECRET | &#064;FILE ] : specify username and either password or API token (or load from them both from a file);<br \/>\n                                 for use with -http.<br \/>\n                                 Passing credentials by file is recommended.<br \/>\n                                 See https:\/\/www.jenkins.io\/redirect\/cli-http-connection-mode for more info and options.<br \/>\n -bearer [ TOKEN | &#064;FILE ]     : specify authentication using a bearer token (or load the token from file);<br \/>\n                                 for use with -http. Mutually exclusive with -auth.<br \/>\n                                 Passing credentials by file is recommended.<\/p>\n<p>The available commands depend on the server. Run the &#039;help&#039; command to see the list.<\/p>\n<p>\u7ed1\u5b9a\u7528\u6237<\/p>\n<p>java -jar jenkins-cli.jar -s http:\/\/admin:123456&#064;10.0.0.10:8080\/ <\/p>\n<p>\u505c\u6b62\u670d\u52a1<\/p>\n<p>systemctl stop jenkins <\/p>\n<p>\u5220\u9664jenkins\u4e3b\u76ee\u5f55\u4e2dconfig.xml\u7684\u5982\u4e0b\u5185\u5bb9<\/p>\n<p>vim \/var\/lib\/jenkins\/config.xml<br \/>\n\u2026\u2026<br \/>\n  &lt;useSecurity&gt;true&lt;\/useSecurity&gt;<br \/>\n  &lt;authorizationStrategy class&#061;&#034;hudson.security.FullControlOnceLoggedInAuthorizationStrategy&#034;&gt;<br \/>\n    &lt;denyAnonymousReadAccess&gt;true&lt;\/denyAnonymousReadAccess&gt;<br \/>\n  &lt;\/authorizationStrategy&gt;<br \/>\n  &lt;securityRealm class&#061;&#034;hudson.security.HudsonPrivateSecurityRealm&#034;&gt;<br \/>\n    &lt;disableSignup&gt;true&lt;\/disableSignup&gt;<br \/>\n    &lt;enableCaptcha&gt;false&lt;\/enableCaptcha&gt;<br \/>\n  &lt;\/securityRealm&gt;<br \/>\n\u2026\u2026 <\/p>\n<p>\u5c31\u53ef\u4ee5\u76f4\u63a5\u8fdb\u6765\u4e86<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"637\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034315-69a112d314482.png\" width=\"1531\" \/><\/p>\n<p>\u4f46\u662f\u4f1a\u53d1\u73b0\u7528\u6237\u7ba1\u7406\u7684\u6309\u94ae\u6ca1\u6709\u4e86<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"441\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034315-69a112d389c20.png\" width=\"1798\" \/><\/p>\n<p>\u4fee\u6539\u5b89\u5168\u914d\u7f6e\u4e3aJenkins&#039;s own user database(Jenkins\u4e13\u6709\u7528\u6237\u6570\u636e\u5e93)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"465\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034316-69a112d40a3b0.png\" width=\"1745\" \/><\/p>\n<p>\u53ef\u4ee5\u8fdb\u5165admin\u8d26\u6237\u4fee\u6539\u5bc6\u7801<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"810\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034316-69a112d46e730.png\" width=\"1670\" \/><\/p>\n<p>\u8fd8\u539f\u8bbe\u7f6e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"515\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034317-69a112d5178fb.png\" width=\"1659\" \/><\/p>\n<h3>&#xff08;\u4e8c&#xff09;Jenkins \u7ed3\u5408 GitLab \u5b9e\u73b0\u4ee3\u7801\u4e0b\u8f7d<\/h3>\n<h4>1.\u67b6\u6784<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"547\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034317-69a112d5848e0.png\" width=\"583\" \/><\/p>\n<p>\u601d\u8def&#xff1a;<\/p>\n<p>1.\u4ecegitlab\u4e0b\u8f7djenkins<\/p>\n<p> git clone git&#064;gitlab.lty.org:devops\/wheel.git <\/p>\n<p>2.\u6253\u901a jenkins \u4e3b\u673a\u548c gitlab \u4e3b\u673a\u7684 key \u9a8c\u8bc1<\/p>\n<p>3.\u6253\u901a jenkins \u4e3b\u673a\u548c10.0.011\u300110.0.012\u7684key\u9a8c\u8bc1<\/p>\n<p>3.\u5c06wheel\u9879\u76ee\u6587\u4ef6\u4ecejenkins\u4f20\u523010.0.0.11\u300110.0.0.12<\/p>\n<p> scp -r wheel\/* root&#064;10.0.0.11:\/var\/www\/html<br \/>\nscp -r wheel\/* root&#064;10.0.0.12:\/var\/www\/html <\/p>\n<p>\u628a\u76f8\u5173\u9879\u76ee\u5bfc\u5165\u5230\u81ea\u5df1\u7684gitlab\u4e2d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"534\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034317-69a112d5a037f.png\" width=\"734\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"864\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034317-69a112d5be149.png\" width=\"1734\" \/><\/p>\n<h4>2.\u914d\u7f6e\u73af\u5883<\/h4>\n<h5>&#xff08;1&#xff09;\u00a0Jenkins \u670d\u52a1\u5668\u521b\u5efa\u8bbf\u95eeGitLab\u7684\u51ed\u636e<\/h5>\n<p>\u4e3a\u4e86\u5b9e\u73b0jenkins\u548cgitlab\u7684\u901a\u4fe1&#xff0c;\u5e76\u4e14\u5b9e\u73b0\u81ea\u52a8\u5316&#xff0c;\u9700\u8981\u6253\u901akey\u9a8c\u8bc1<\/p>\n<p>\u5728 Jenkins \u670d\u52a1\u5668\u4e0a\u751f\u6210 ssh key \u6ce8\u610fjenkins\u4f7f\u7528\u7684\u662fjenkins\u7528\u6237\u6267\u884c\u76f8\u5173\u547d\u4ee4&#xff0c;\u6240\u4ee5\u6211\u4eec\u9700\u8981\u518djenkins\u7528\u6237\u4e0b\u83b7\u53d6\u5bc6\u94a5\u5bf9<\/p>\n<p>root&#064;ubuntu10:\/data\/jenkins\/scripts  su &#8211; jenkins<br \/>\njenkins&#064;ubuntu10:~$ ssh-keygen<\/p>\n<p>jenkins&#064;ubuntu10:~$ cat .ssh\/id_ed25519<br \/>\n&#8212;&#8211;BEGIN OPENSSH PRIVATE KEY&#8212;&#8211;<br \/>\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW<br \/>\nQyNTUxOQAAACArPsIxhY8SiKsbwtXceCwhzN0sQHtoXi4yYi&#043;8XfmRLQAAAJjT5FWt0&#043;RV<br \/>\nrQAAAAtzc2gtZWQyNTUxOQAAACArPsIxhY8SiKsbwtXceCwhzN0sQHtoXi4yYi&#043;8XfmRLQ<br \/>\nAAAEA\/71627nSjrTaMA1G2in2MKZxgznJnu2i8P2IPs4eIvSs&#043;wjGFjxKIqxvC1dx4LCHM<br \/>\n3SxAe2heLjJiL7xd&#043;ZEtAAAAEGplbmtpbnNAdWJ1bnR1MTABAgMEBQ&#061;&#061;<br \/>\n&#8212;&#8211;END OPENSSH PRIVATE KEY&#8212;&#8211;<\/p>\n<p>jenkins&#064;ubuntu10:~$ cat .ssh\/id_ed25519.pub<br \/>\nssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICs&#043;wjGFjxKIqxvC1dx4LCHM3SxAe2heLjJiL7xd&#043;ZEt jenkins&#064;ubuntu10<\/p>\n<h5>&#xff08;2&#xff09;\u5728 Gitlab\u670d\u52a1\u5668\u4e0a\u7528\u6237\u4e2d\u5173\u8054 Jenkins \u751f\u6210\u7684ssh \u516c\u94a5key<\/h5>\n<p>\u5728GitLab\u4e2d\u9879\u76ee\u5177\u6709\u8bbf\u95ee\u6743\u9650\u7684\u7528\u6237\u5e10\u53f7\u7684profile\u4e2d\u5bfc\u5165Jenkins\u7684\u516c\u94a5&#xff1b;\u6211\u8fd9\u91cc\u5c31\u7528 lty \u8d26\u6237<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"607\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034318-69a112d667f33.png\" width=\"1471\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"893\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034318-69a112d6ae07e.png\" width=\"1904\" \/><\/p>\n<p>\u4f46\u662f\u5728\u7b2c\u4e00\u6b21\u4f7f\u7528 git clone \u547d\u4ee4\u7684\u65f6\u5019\u4f1a\u89e6\u53d1SSH\u7684\u5b89\u5168\u534f\u8bae&#xff0c;\u5728\u81ea\u52a8\u5316\u8fc7\u7a0b\u4e2d\u9700\u8981\u5c06\u5176\u5173\u95ed<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"141\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034319-69a112d764f87.png\" width=\"865\" \/><\/p>\n<p>\u5728jenkins \u4e3b\u673a\u4e0a\u914d\u7f6eSSH&#xff1b;\u672c\u8d28\u5c31\u662f\u5728\u8fdb\u884cSSH\u4f20\u8f93\u7684\u65f6\u5019&#xff0c;\u628a\u8fdc\u7a0b\u4e3b\u673a\u7684\u516c\u94a5\u76f4\u63a5\u62c9\u53d6\u8fc7\u6765<\/p>\n<p>root&#064;ubuntu10:~  vim \/etc\/ssh\/ssh_config<br \/>\n\u2026\u2026<br \/>\n#   CheckHostIP no<br \/>\n#   AddressFamily any<br \/>\n#   ConnectTimeout 0<br \/>\n   StrictHostKeyChecking no         #\u53bb\u9664\u6ce8\u91ca&#xff0c;\u628aask\u6539\u6210no<br \/>\n#   IdentityFile ~\/.ssh\/id_rsa<br \/>\n#   IdentityFile ~\/.ssh\/id_dsa<br \/>\n#   IdentityFile ~\/.ssh\/id_ecdsa<br \/>\n\u2026\u2026 <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"213\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034319-69a112d785f3a.png\" width=\"918\" \/><\/p>\n<h5>&#xff08;3&#xff09;\u5c06wheel\u9879\u76ee\u6587\u4ef6\u4ecejenkins\u4f20\u523010.0.0.11\u300110.0.0.12<\/h5>\n<p>\u9996\u5148\u9700\u8981\u6253\u901a jenkins \u4e3b\u673a\u4e0e\u00a010.0.0.11\u300110.0.0.12 \u7684key\u9a8c\u8bc1<\/p>\n<p>\u4e0a\u4e00\u6b65\u4e2d\u5df2\u7ecf\u751f\u6210\u8fc7\u5bc6\u94a5\u5bf9&#xff0c;\u4e0d\u7136\u5148\u83b7\u53d6\u5bc6\u94a5\u5bf9 ssh-keygen<br \/>\njenkins&#064;ubuntu10:~$ ssh-copy-id root&#064;10.0.0.11<\/p>\n<p>root&#064;ubuntu11:~  ls .ssh\/<br \/>\nauthorized_keys        #\u751f\u6210\u7684\u516c\u94a5<\/p>\n<p>jenkins&#064;ubuntu10:~$ ssh-copy-id root&#064;10.0.0.12<\/p>\n<p>scp -r wheel\/* root&#064;10.0.0.11:\/var\/www\/html<br \/>\nscp -r wheel\/* root&#064;10.0.0.12:\/var\/www\/html <\/p>\n<h4>3.\u51c6\u5907\u811a\u672c\u5e76\u5728jenkins\u6267\u884c\u6784\u5efa<\/h4>\n<p>\u521b\u5efa\u76ee\u5f55<br \/>\nroot&#064;ubuntu10:  mkdir \/data\/jenkins\/scripts -p<br \/>\nroot&#064;ubuntu10:  cd \/data\/jenkins\/scripts<\/p>\n<p>root&#064;ubuntu10:\/data\/jenkins\/scripts  vim wheel.sh<br \/>\n#!\/bin\/bash<br \/>\n#wheel_test<\/p>\n<p>NET&#061;10.0.0<br \/>\nID&#061;&#034;<br \/>\n11<br \/>\n12&#034;<\/p>\n<p>git clone git&#064;gitlab.lty.org:devops\/wheel.git<\/p>\n<p>for i in $ID;do<br \/>\nscp -r wheel\/* root&#064;$NET.$i:\/var\/www\/html <\/p>\n<p>\u5728 jenkins \u4e2d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"645\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034319-69a112d7ab5fe.png\" width=\"1651\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"550\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034320-69a112d83957b.png\" width=\"710\" \/><\/p>\n<p>\u8bbf\u95ee\u4e00\u4e0b\u4e24\u4e2a\u4e3b\u673a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"898\" src=\"2026-02-27n24eudk00lw.png\" width=\"1817\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"874\" src=\"2026-02-27geqektjk324.png\" width=\"1787\" \/><\/p>\n<h3>&#xff08;\u4e09&#xff09;jenkins\u4e0a\u7528gitlab\u63d2\u4ef6\u5b9e\u73b0\u4e92\u8054<\/h3>\n<h4>1.\u4f7f\u7528http\u534f\u8bae\u914d\u7f6e Git \u9879\u76ee\u5730\u5740\u548c\u51ed\u8bc1<\/h4>\n<p>\u5b89\u88c5gitlab\u63d2\u4ef6<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"399\" src=\"2026-02-27mc1xythp5fl.png\" width=\"1805\" \/><\/p>\n<p>\u521b\u5efa\u51ed\u636e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"753\" src=\"2026-02-27g1wzmr5xdim.png\" width=\"1637\" \/><\/p>\n<p>\u811a\u672c\u5c31\u9700\u8981\u53d8\u5316<\/p>\n<p>#!\/bin\/bash<br \/>\n#wheel_test<\/p>\n<p>NET&#061;10.0.0<br \/>\nID&#061;&#034;<br \/>\n11<br \/>\n12&#034;<\/p>\n<p>#git clone git&#064;gitlab.lty.org:devops\/wheel.git        #\u4e0a\u9762\u7684gitlab\u76f8\u5f53\u4e8e\u5b8c\u6210\u811a\u672c\u4e2d\u7684\u8fd9\u4e00\u6b65<\/p>\n<p>for i in $ID;do<br \/>\n#scp -r wheel\/* root&#064;$NET.$i:\/var\/www\/html        #\u901a\u8fc7\u63d2\u4ef6\u62c9\u53d6\u4e0b\u6765\u7684\u5de5\u4f5c\u76ee\u5f55\u4f1a\u5728 \/vat\/lib\/jenkins\/workspeace\/freestyle-wheel \u4e0b<br \/>\nscp -r * root&#064;$NET.$i:\/var\/www\/html               #\u6240\u4ee5\u76f4\u63a5 * \u5c31\u53ef\u4ee5\u4e86 <\/p>\n<p>done <\/p>\n<p>\u6267\u884c\u6784\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"856\" src=\"2026-02-272f5hlzzexjt.png\" width=\"1777\" \/><\/p>\n<h4>2.\u4f7f\u7528SSH\u534f\u8bae<\/h4>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4f7f\u7528\u63d2\u4ef6\u914d\u5bf9\u5c31\u65e0\u6240\u8c13\u4f7f\u7528\u7684\u662f\u4ec0\u4e48\u7528\u6237&#xff0c;\u54ea\u4e2a\u4e3b\u673a&#xff0c;\u63d0\u53d6\u7684\u90fd\u662f\u8fd9\u4e2a\u5bc6\u94a5\u5bf9&#xff1b;\u4f8b\u5982\u6211\u4eec\u8fd9\u91cc\u6545\u610f\u752810.0.0.11\u4e3b\u673a\u6765\u521b\u5efa<\/p>\n<p>root&#064;ubuntu11:~  ssh-keygen<br \/>\nroot&#064;ubuntu11:~  cat .ssh\/id_ed25519 .ssh\/id_ed25519.pub<br \/>\n&#8212;&#8211;BEGIN OPENSSH PRIVATE KEY&#8212;&#8211;<br \/>\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW<br \/>\nQyNTUxOQAAACD2enizbYYIl5M7z9jO2Gl\/IblKDpmDEEbuaY1cCwwunwAAAJCXCJHmlwiR<br \/>\n5gAAAAtzc2gtZWQyNTUxOQAAACD2enizbYYIl5M7z9jO2Gl\/IblKDpmDEEbuaY1cCwwunw<br \/>\nAAAECJhTrmhlA7UezB5JUsk6hUvl3qQxtYRS36OlEsG6bgCPZ6eLNthgiXkzvP2M7YaX8h<br \/>\nuUoOmYMQRu5pjVwLDC6fAAAADXJvb3RAdWJ1bnR1MTE&#061;<br \/>\n&#8212;&#8211;END OPENSSH PRIVATE KEY&#8212;&#8211;<br \/>\nssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPZ6eLNthgiXkzvP2M7YaX8huUoOmYMQRu5pjVwLDC6f root&#064;ubuntu11<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"774\" src=\"2026-02-27yjsfgotdors.png\" width=\"1256\" \/><\/p>\n<p>\u6dfb\u52a0\u79c1\u94a5<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"625\" src=\"2026-02-271ulm3krnsvl.png\" width=\"1253\" \/><\/p>\n<p>gitlab\u7684lty\u8d26\u53f7\u4e0a\u9762\u6dfb\u52a0\u516c\u94a5<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"668\" src=\"2026-02-27myzigxxvsha.png\" width=\"1749\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"815\" src=\"2026-02-27yyps3xkrz2b.png\" width=\"1679\" \/><\/p>\n<p>\u7528 10.0.0.10 \u4e3b\u673a\u7684 jenkins \u8d26\u6237\u521b\u5efa\u5bc6\u94a5\u5bf9&#xff0c;\u7ed9 10.0.0.11 \u548c 10.0.0.12 \u6253\u901a key \u9a8c\u8bc1<\/p>\n<p>jenkins&#064;ubuntu10:~$ ssh-keygen<br \/>\njenkins&#064;ubuntu10:~$ ls .ssh\/<br \/>\nid_ed25519  id_ed25519.pub  known_hosts<\/p>\n<p>jenkins&#064;ubuntu10:~$ ssh-copy-id root&#064;10.0.0.11<br \/>\njenkins&#064;ubuntu10:~$ ssh-copy-id root&#064;10.0.0.12<\/p>\n<p>\u6267\u884c\u6784\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"820\" src=\"2026-02-27u11dcgm3vc5.png\" width=\"1234\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"927\" src=\"2026-02-27dxyge4qofhz.png\" width=\"1813\" \/><\/p>\n<h3>&#xff08;\u56db&#xff09;\u914d\u7f6e Jenkins \u7ed3\u5408 GitLab \u5b9e\u73b0\u81ea\u52a8\u5316\u524d\u7aef\u9879\u76ee\u7684\u90e8\u7f72\u548c\u56de\u6eda<\/h3>\n<h4 style=\"background-color:transparent\">1.\u5148\u628a\u811a\u672c\u51c6\u5907\u597d<\/h4>\n<p>#!\/bin\/bash<\/p>\n<p>HOST_LIST&#061;&#034;<br \/>\n10.0.0.11<br \/>\n10.0.0.12<br \/>\n&#034;<br \/>\nAPP&#061;wheel<br \/>\nAPP_PATH&#061;\/var\/www\/html<br \/>\nDATA_PATH&#061;\/opt<br \/>\nDATE&#061;&#096;date &#043;%F_%H-%M-%S&#096;<\/p>\n<p>deploy () {<br \/>\n    for i in ${HOST_LIST};do<br \/>\n        ssh root&#064;i &#034;rm -f ${APP_PATH} &amp;&amp; mkdir -pv ${DATA_PATH}\/${APP}-${DATE}&#034;<br \/>\n        scp -r * root&#064;${i}:${DATA_PATH}\/${APP}-${DATE}<br \/>\n        ssh root&#064;${i} &#034;ln -sv ${DATA_PATH}\/${APP}-${DATE} ${APP_PATH}&#034;<br \/>\n    done<br \/>\n}<\/p>\n<p>rollback() {<br \/>\n    for i in ${HOST_LIST};do<br \/>\n        CURRENT_VERSION&#061;$(ssh root&#064;${i} &#034;readlink ${APP_PATH}&#034;)<br \/>\n        CURRENT_VERSION&#061;$(basename ${CURRENT_VERSION})<br \/>\n        echo ${CURRENT_VERSION}<br \/>\n        PRE_VERSION&#061;$(ssh root&#064;${i} &#034;ls -1 ${DATA_PATH} | grep -B1 ${CURRENT_VERSION} | head -n1 &#034;)<br \/>\n        echo ${PRE_VERSION}<br \/>\n        ssh root&#064;${i} &#034;rm -f ${APP_PATH} &amp;&amp; ln -sv ${DATA_PATH}\/${PRE_VERSION} ${APP_PATH}&#034;<br \/>\n    done<br \/>\n}<\/p>\n<p>case $1 in<br \/>\ndeploy)<br \/>\n    deploy<br \/>\n    ;;<br \/>\nrollback)<br \/>\n    rollback<br \/>\n    ;;<br \/>\n*)<br \/>\n    exit<br \/>\n    ;;<br \/>\nesac <\/p>\n<p>\u572810.0.0.11\u548c10.0.0.12\u4e3b\u673a\u4e0a\u5c06 html \u76ee\u5f55\u6362\u4e2a\u5730\u65b9\u5b9e\u73b0\u811a\u672c\u91cc\u9762\u7684\u8f6f\u8fde\u63a5<\/p>\n<p>root&#064;ubuntu12:~  mv \/var\/www\/html\/ \/srv\/ <\/p>\n<h4>2.\u65b0\u5efaitem<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"772\" src=\"2026-02-27kiolfk0aewn.png\" width=\"1468\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"337\" src=\"2026-02-272g3mn55ssod.png\" width=\"1341\" \/><\/p>\n<h4>3.\u66f4\u65b0\u9879\u76ee\u4ed3\u5e93\u5e76\u6784\u5efa<\/h4>\n<p>root&#064;ubuntu14:~\/wheel  vim index.html<br \/>\nroot&#064;ubuntu14:~\/wheel  git commit -am &#034;\u4e8c\u7b49\u595650\u4e07&#034;<br \/>\n[master db435f6] \u4e8c\u7b49\u595650\u4e07<br \/>\n 1 file changed, 1 insertion(&#043;), 1 deletion(-)<br \/>\nroot&#064;ubuntu14:~\/wheel  git push &#8211;all<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"418\" src=\"2026-02-27qyeukbhh1o1.png\" width=\"1572\" \/><\/p>\n<p>\u6839\u636e\u811a\u672c\u5185\u5bb9\u521b\u5efa\u4e86\u8f6f\u8fde\u63a5<\/p>\n<p>root&#064;ubuntu11:~  ll \/var\/www\/<br \/>\n\u603b\u8ba1 8<br \/>\ndrwxr-xr-x  2 root root 4096  2\u6708  4 18:30 .\/<br \/>\ndrwxr-xr-x 15 root root 4096  2\u6708  3 16:18 ..\/<br \/>\nlrwxrwxrwx  1 root root   30  2\u6708  4 18:30 html -&gt; \/opt\/wheel-2026-02-04_18-30-44\/<\/p>\n<h4>4.\u66f4\u65b0\u7b2c\u4e8c\u4e2a\u7248\u672c\u9879\u76ee<\/h4>\n<p>root&#064;ubuntu14:~\/wheel  vim index.html<br \/>\nroot&#064;ubuntu14:~\/wheel  git commit -am &#034;\u4e00\u7b49\u5956500\u4e07&#034;<br \/>\nroot&#064;ubuntu14:~\/wheel  git push &#8211;all<\/p>\n<p>\u6784\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"322\" src=\"2026-02-27iads1fesjuz.png\" width=\"1292\" \/><\/p>\n<p>\u5728\u66f4\u65b0\u4e00\u4e2a\u7248\u672c\u65b9\u4fbf\u6bd4\u8f83<\/p>\n<p>root&#064;ubuntu14:~\/wheel  vim index.html<br \/>\nroot&#064;ubuntu14:~\/wheel  git commit -am &#034;\u7279\u7b49\u59561000\u4e07&#034;<br \/>\nroot&#064;ubuntu14:~\/wheel  git push &#8211;all<\/p>\n<p>\u6784\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"329\" src=\"2026-02-275wdshln0uvo.png\" width=\"1078\" \/><\/p>\n<h4>5.\u521b\u5efa\u4e00\u4e2a\u65b0\u7684item\u8d1f\u8d23\u56de\u9000<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"716\" src=\"2026-02-27shtdgiwbg4y.png\" width=\"1005\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"516\" src=\"2026-02-270gwv2hd2nrr.png\" width=\"1385\" \/><\/p>\n<p>\u76ee\u524d\u7248\u672c\u662f\u201c\u7279\u7b49\u59561000\u4e07\u201d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"839\" src=\"2026-02-27vzaa3gmv4d0.png\" width=\"1109\" \/><\/p>\n<p>\u6267\u884c\u6784\u5efa\u56de\u9000\u6210\u529f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"826\" src=\"2026-02-27vqw1wedjmys.png\" width=\"933\" \/><\/p>\n<p>\u672c\u8d28\u5c31\u662f\u5728 10.0.0.11 \u548c 10.0.0.12 \u4e3b\u673a\u7684\u8f6f\u8fde\u63a5\u6307\u5411\u4e86\u4e0a\u4e00\u4e2a\u7248\u672c<\/p>\n<p>root&#064;ubuntu11:~  ll \/opt<br \/>\n\u603b\u8ba1 28<br \/>\ndrwxr-xr-x  7 root root 4096  2\u6708  4 19:08 .\/<br \/>\ndrwxr-xr-x 23 root root 4096 11\u6708  5 11:20 ..\/<br \/>\ndrwxr-xr-x  4 root root 4096  2\u6708  4 18:58 wheel-2026-02-04_18-30-44\/<br \/>\ndrwxr-xr-x  4 root root 4096  2\u6708  4 18:43 wheel-2026-02-04_18-43-37\/<br \/>\ndrwxr-xr-x  4 root root 4096  2\u6708  4 18:58 wheel-2026-02-04_18-58-26\/<br \/>\ndrwxr-xr-x  4 root root 4096  2\u6708  4 19:06 wheel-2026-02-04_19-06-36\/<br \/>\ndrwxr-xr-x  4 root root 4096  2\u6708  4 19:08 wheel-2026-02-04_19-08-22\/<br \/>\nroot&#064;ubuntu11:~  ll \/var\/www\/<br \/>\n\u603b\u8ba1 8<br \/>\ndrwxr-xr-x  2 root root 4096  2\u6708  4 19:13 .\/<br \/>\ndrwxr-xr-x 15 root root 4096  2\u6708  3 16:18 ..\/<br \/>\nlrwxrwxrwx  1 root root   30  2\u6708  4 19:13 html -&gt; \/opt\/wheel-2026-02-04_19-06-36\/<\/p>\n<h3>&#xff08;\u4e94&#xff09;\u53c2\u6570\u5316\u6784\u5efa<\/h3>\n<p>\u5e38\u7528\u7684\u53c2\u6570\u7c7b\u578b&#xff1a; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u9009\u9879\u53c2\u6570 Choice Parameter \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5e03\u5c14\u503c\u53c2\u6570 Boolean Parameter \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5b57\u7b26\u53c2\u6570 String Parameter \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6587\u672c\u53c2\u6570 Multi-line String Parameter \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u51ed\u636e\u53c2\u6570 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5bc6\u7801\u53c2\u6570 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6587\u4ef6\u53c2\u6570 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd0\u884c\u65f6\u53c2\u6570<\/p>\n<p>\u57fa\u4e8e&#xff08;\u56db&#xff09;\u9879\u76ee&#xff0c;\u5728\u4e00\u4e2aitem\u4e2d\u5b8c\u6210\u90e8\u7f72\u548c\u56de\u6eda<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"717\" src=\"2026-02-27eb1q4fmvkkl.png\" width=\"995\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"257\" src=\"2026-02-27ps0c1yp2vtr.png\" width=\"1269\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"666\" src=\"2026-02-273d3imux13vg.png\" width=\"1337\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"429\" src=\"2026-02-27srv2bw5rhm3.png\" width=\"1666\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"397\" src=\"2026-02-27m0js2jupzn0.png\" width=\"1658\" \/><\/p>\n<h2>\u4e8c\u3001\u81ea\u7531\u98ce\u683c\u7684\u4efb\u52a1\u6784\u5efa\u57fa\u4e8e Spring Boot \u7684 JAR \u5305 JAVA \u9879\u76ee<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"212\" src=\"2026-02-27apcdv0qvbma.png\" width=\"967\" \/><\/p>\n<h4>1.\u00a0Jenkins \u670d\u52a1\u5668\u4e0a\u5b89\u88c5 maven \u548c\u914d\u7f6e\u955c\u50cf\u52a0\u901f<\/h4>\n<p>root&#064;ubuntu10:\/data\/jenkins\/scripts  apt install maven -y<br \/>\n\u955c\u50cf\u52a0\u901f<br \/>\nroot&#064;ubuntu10:\/data\/jenkins\/script  vim \/etc\/maven\/settings.xml<br \/>\n&#8230;..<br \/>\n    &lt;mirror&gt;<br \/>\n        &lt;id&gt;nexus-aliyun&lt;\/id&gt;<br \/>\n        &lt;mirrorOf&gt;*&lt;\/mirrorOf&gt;<br \/>\n        &lt;name&gt;Nexus aliyun&lt;\/name&gt;<br \/>\n        &lt;url&gt;http:\/\/maven.aliyun.com\/nexus\/content\/groups\/public&lt;\/url&gt;<br \/>\n    &lt;\/mirror&gt;<br \/>\n&lt;\/mirrors&gt; <\/p>\n<h4>2.\u5728\u76ee\u6807\u4e3b\u673a\u5b89\u88c5 JAVA \u73af\u5883<\/h4>\n<p>apt update &amp;&amp; apt -y install openjdk-21-jre <\/p>\n<h4>3.\u51c6\u5907\u76f8\u5173\u811a\u672c<\/h4>\n<p>#!\/bin\/bash<br \/>\nAPP&#061;spring-boot-helloworld<br \/>\nAPP_PATH&#061;\/data\/${APP}<\/p>\n<p># \u8fdc\u7a0b\u90e8\u7f72\u76ee\u6807\u4e3b\u673a\u5217\u8868<br \/>\nHOST_LIST&#061;&#034;<br \/>\n10.0.0.11<br \/>\n10.0.0.12<br \/>\n&#034;<br \/>\n# \u9879\u76ee\u8fd0\u884c\u7aef\u53e3<br \/>\nPORT&#061;80<\/p>\n<p># \u672c\u5730Maven\u6253\u5305&#xff0c;\u8df3\u8fc7\u6d4b\u8bd5\u7528\u4f8b&#xff08;\u52a0\u5feb\u6784\u5efa\u901f\u5ea6&#xff09;<br \/>\nmvn clean package -Dmaven.test.skip&#061;true<\/p>\n<p># \u904d\u5386\u8fdc\u7a0b\u4e3b\u673a&#xff0c;\u6267\u884c\u6279\u91cf\u90e8\u7f72<br \/>\nfor host in ${HOST_LIST};do<br \/>\n    ssh root&#064;${host} &#034;[ -e ${APP_PATH} ] || mkdir -p ${APP_PATH}&#034;<br \/>\n    ssh root&#064;${host} killall -9 java &amp;&gt; \/dev\/null<br \/>\n    scp target\/${APP}-*-SNAPSHOT.jar root&#064;${host}:${APP_PATH}\/${APP}.jar<br \/>\n    ssh root&#064;${host} &#034;nohup java -jar ${APP_PATH}\/${APP}.jar &#8211;server.port&#061;${PORT} &amp;&gt;\/dev\/null &amp;&#034;<br \/>\ndone <\/p>\n<h4>4.\u65b0\u5efaitem<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"781\" src=\"2026-02-273js0snnauhg.png\" width=\"1294\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"485\" src=\"2026-02-27pae5rukjb54.png\" width=\"1275\" \/><\/p>\n<p>\u6784\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"267\" src=\"2026-02-275emnu3isvuh.png\" width=\"1067\" \/><\/p>\n<p>\u76ee\u6807\u4e3b\u673a\u6210\u529f\u6784\u5efa\u4e86java\u9879\u76ee<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"517\" src=\"2026-02-275tssjhzp4lv.png\" width=\"1674\" \/><\/p>\n<h2>\u4e09\u3001\u5229\u7528 Git Parameter \u63d2\u4ef6\u5b9e\u73b0\u62c9\u53d6\u6307\u5b9a\u7248\u672c<\/h2>\n<p>\u57fa\u4e8e \u4e8c\u3001 \u7684\u57fa\u7840\u4e0a<\/p>\n<p>\u628a\u9879\u76ee\u62c9\u5230\u5f00\u53d1\u673a10.0.0.14\u4e0a&#xff0c;\u4fee\u6539\u00a0vim src\/main\/java\/com\/neo\/controller\/HelloWorldController.java \u6587\u4ef6\u628a\u5176\u4e2d\u7684 v0.5 \u6539\u6210 v0.6&#xff1b;\u7136\u540e\u4e0a\u4f20\u4ed3\u5e93\u5e76\u91cd\u65b0\u6784\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"577\" src=\"2026-02-27uqaerqtes42.png\" width=\"716\" \/><\/p>\n<p>\u5728jenkins\u7684\u63d2\u4ef6\u5546\u5e97\u4e2d\u5b89\u88c5 git parameter\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"422\" src=\"2026-02-27nzgjxnjz5cv.png\" width=\"332\" \/><\/p>\n<p>\u652f\u6301\u5206\u652f\u7b49<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"199\" src=\"2026-02-27j5qrx5fulrq.png\" width=\"1224\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"716\" src=\"2026-02-27hz0b30u02vj.png\" width=\"1273\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"773\" src=\"2026-02-274rmbpqgnrzf.png\" width=\"1296\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"744\" src=\"2026-02-27f13eqwhhxwr.png\" width=\"1647\" \/><\/p>\n<p>\u6784\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"120\" src=\"2026-02-273gqv5h1ni3m.png\" width=\"328\" \/><\/p>\n<h2>\u56db\u3001\u81ea\u7531\u98ce\u683c\u7684\u4efb\u52a1\u6784\u5efa\u82e5\u4f9d RuoYi \u7ba1\u7406\u5e73\u53f0<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"212\" src=\"2026-02-273klqc0dfwn0.png\" width=\"967\" \/><\/p>\n<p>\u4ecegitlab\u4e2d\u5bfc\u5165\u9879\u76ee<\/p>\n<p>root&#064;ubuntu11:~  git clone http:\/\/gitlab.lty.org\/devops\/RuoYi.git <\/p>\n<h4>1.\u51c6\u5907\u6570\u636e\u5e93<\/h4>\n<p>\u786e\u5b9a\u57df\u540d\u548c\u6570\u636e\u5e93\u540d\u79f0\u53ca\u5bc6\u7801<\/p>\n<p>root&#064;ubuntu11:~  vim RuoYi\/ruoyi-admin\/src\/main\/resources\/application-druid.yml <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"283\" src=\"2026-02-27rbsc25n1pu4.png\" width=\"985\" \/><\/p>\n<p>\u51c6\u5907MySQL<\/p>\n<p>root&#064;ubuntu11:~  vim \/etc\/mysql\/mysql.conf.d\/mysqld.cnf<br \/>\nroot&#064;ubuntu11:~  systemctl restart mysql.service <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"111\" src=\"2026-02-27z05uelfzncd.png\" width=\"816\" \/><\/p>\n<p>\u914d\u7f6e\u6570\u636e\u5e93<\/p>\n<p>root&#064;ubuntu11:~  mysql<\/p>\n<p>mysql&gt; create database ry;<br \/>\nmysql&gt; create user ry&#064;&#039;10.0.0.%&#039; identified by &#039;123456&#039;;<br \/>\nmysql&gt; grant all on ry.* to ry&#064;&#039;10.0.0.%&#039;;<\/p>\n<p>\u5bfc\u5165\u6570\u636e\u8868<br \/>\nmysql&gt; use ry<br \/>\nmysql&gt; source RuoYi\/sql\/quartz.sql<br \/>\nmysql&gt; source RuoYi\/sql\/ry_20240112.sql<\/p>\n<p>mysql&gt; show tables;<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| Tables_in_ry             |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n| QRTZ_BLOB_TRIGGERS       |<br \/>\n| QRTZ_CALENDARS           |<br \/>\n| QRTZ_CRON_TRIGGERS       |<br \/>\n| QRTZ_FIRED_TRIGGERS      |<br \/>\n| QRTZ_JOB_DETAILS         |<br \/>\n| QRTZ_LOCKS               |<br \/>\n| QRTZ_PAUSED_TRIGGER_GRPS |<br \/>\n| QRTZ_SCHEDULER_STATE     |<br \/>\n| QRTZ_SIMPLE_TRIGGERS     |<br \/>\n| QRTZ_SIMPROP_TRIGGERS    |<br \/>\n| QRTZ_TRIGGERS            |<br \/>\n| gen_table                |<br \/>\n| gen_table_column         |<br \/>\n| sys_config               |<br \/>\n| sys_dept                 |<br \/>\n| sys_dict_data            |<br \/>\n| sys_dict_type            |<br \/>\n| sys_job                  |<br \/>\n| sys_job_log              |<br \/>\n| sys_logininfor           |<br \/>\n| sys_menu                 |<br \/>\n| sys_notice               |<br \/>\n| sys_oper_log             |<br \/>\n| sys_post                 |<br \/>\n| sys_role                 |<br \/>\n| sys_role_dept            |<br \/>\n| sys_role_menu            |<br \/>\n| sys_user                 |<br \/>\n| sys_user_online          |<br \/>\n| sys_user_post            |<br \/>\n| sys_user_role            |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#043;<br \/>\n31 rows in set (0.00 sec)<\/p>\n<h4>2.\u5728Jenkins\u51c6\u5907MAVEN\u548cJAVA\u73af\u5883<\/h4>\n<p>apt update &amp;&amp; apt -y install maven<br \/>\nvim \/etc\/maven\/settings.xml<br \/>\n&#8230;..<br \/>\n   &lt;mirror&gt;<br \/>\n      &lt;id&gt;nexus-aliyun&lt;\/id&gt;<br \/>\n      &lt;mirrorOf&gt;*&lt;\/mirrorOf&gt;<br \/>\n      &lt;name&gt;Nexus aliyun&lt;\/name&gt;<br \/>\n      &lt;url&gt;http:\/\/maven.aliyun.com\/nexus\/content\/groups\/public&lt;\/url&gt;<br \/>\n   &lt;\/mirror&gt;<br \/>\n&lt;\/mirrors&gt;<br \/>\n&#8230;&#8230; <\/p>\n<h4>3.\u5728\u90e8\u7f72\u5e94\u7528\u7684\u76ee\u6807\u670d\u52a1\u5668\u51c6\u5907\u73af\u5883<\/h4>\n<p>\u6cbf\u7528\u7684\u67b6\u6784\u6240\u4ee5\u914d\u7f6e\u4e00\u4e0b10.0.0.11\u548c10.0.0.12\u4e3b\u673a<\/p>\n<p>vim \/etc\/hosts<br \/>\n10.0.0.10 gitlab.lty.org redis.lty.org<br \/>\n10.0.0.11 jenkins.lty.org mysql.lty.org<br \/>\nmkdir -p \/data\/ruoyi<br \/>\napt update &amp;&amp; apt -y install openjdk-21-jre <\/p>\n<h4>4.\u5199\u5165\u811a\u672c<\/h4>\n<p>root&#064;ubuntu10:  vim \/data\/jenkins\/scripts\/freestyle-ruoyi.sh<br \/>\n#!\/bin\/bash<\/p>\n<p># \u53d8\u91cf\u5b9a\u4e49<br \/>\nAPP&#061;ruoyi<br \/>\nAPP_PATH&#061;\/data\/$APP<br \/>\nPORT&#061;80<br \/>\nHOST_LIST&#061;&#034;<br \/>\n10.0.0.11<br \/>\n10.0.0.12<br \/>\n&#034;<\/p>\n<p>mvn clean package -Dmaven.test.skip&#061;true<\/p>\n<p># \u5faa\u73af\u90e8\u7f72\u5230\u76ee\u6807\u670d\u52a1\u5668<br \/>\nfor host in $HOST_LIST;do<br \/>\n    ssh root&#064;$host &#034;[ -e $APP_PATH ] || mkdir -p $APP_PATH&#034;<br \/>\n    ssh root&#064;$host killall -9 java &amp;&gt; \/dev\/null<br \/>\n    scp ruoyi-admin\/target\/*.jar root&#064;$host:${APP_PATH}\/${APP}.jar<br \/>\n    ssh root&#064;$host &#034;nohup java -jar ${APP_PATH}\/${APP}.jar &#8211;server.port&#061;${PORT} &amp;&gt;\/dev\/null &amp;&#034;<br \/>\ndone <\/p>\n<h4>5.\u5728Jenkins\u521b\u5efa\u81ea\u7531\u98ce\u683c\u4efb\u52a1<\/h4>\n<p>\u7ed3\u5408git parameter \u63d2\u4ef6\u5b9e\u73b0\u53c2\u6570\u5316\u6784\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"718\" src=\"2026-02-270q105wpoydj.png\" width=\"1293\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"715\" src=\"2026-02-27ecsjrg4rrno.png\" width=\"1292\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"428\" src=\"2026-02-27rh03r3zmky1.png\" width=\"1271\" \/><\/p>\n<h4>6.\u6267\u884c\u5e76\u9a8c\u8bc1\u4efb\u52a1<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"287\" src=\"2026-02-27pvjkeniz5u5.png\" width=\"948\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"748\" src=\"2026-02-27ki4hmira4tf.png\" width=\"1489\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"692\" src=\"2026-02-27pxlelucaahr.png\" width=\"1477\" \/><\/p>\n<h2>\u4e94\u3001\u6784\u5efa\u540e\u901a\u77e5<\/h2>\n<h3>&#xff08;\u4e00&#xff09;\u90ae\u4ef6\u901a\u77e5<\/h3>\n<h4>1.\u51c6\u5907\u544a\u8b66\u90ae\u7bb1\u914d\u7f6e<\/h4>\n<p>\u5f00\u901a\u8fd9\u4e2a\u670d\u52a1<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"501\" src=\"2026-02-27zsbblthxggs.png\" width=\"1027\" \/><\/p>\n<p>\u8fd9\u4e2a\u63d2\u4ef6\u88c5\u4e00\u4e0b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"331\" src=\"2026-02-27r5daju5e31g.png\" width=\"593\" \/><\/p>\n<h4>2.\u914d\u7f6e Jenkins\u7ba1\u7406\u5458\u53d1\u4fe1\u4ef6\u4eba\u90ae\u7bb1<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"276\" src=\"2026-02-27i31fsdhwdlc.png\" width=\"1056\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"715\" src=\"2026-02-27schle4mlva0.png\" width=\"855\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"252\" src=\"2026-02-27ajlbpwe3fte.png\" width=\"628\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"240\" src=\"2026-02-270kfq4uy4ndo.png\" width=\"536\" \/><\/p>\n<p>\u9009\u62e9\u4e00\u4e2a\u4e0a\u9762\u6784\u5efa\u7684\u9879\u76ee<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"480\" src=\"2026-02-27jbmaugd1udw.png\" width=\"743\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"272\" src=\"2026-02-27ouddeyaod5x.png\" width=\"1255\" \/><\/p>\n<p>\u9996\u6b21\u6210\u529f\u4e0d\u53d1\u90ae\u4ef6&#xff0c;\u5931\u8d25\u540e\u6210\u529f\u4f1a\u53d1&#xff0c;\u5931\u8d25\u3001\u8fde\u7eed\u5931\u8d25\u90fd\u4f1a\u53d1<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"208\" src=\"2026-02-27w4dhdw0mab5.png\" width=\"439\" \/><\/p>\n<p>\u6253\u7801\u7684\u5730\u65b9\u65f6\u9519\u8bef\u7684\u5730\u5740\u53ef\u4ee5\u67e5\u770b\u9519\u8bef\u7684\u662f\u4ec0\u4e48\u9879\u76ee<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"579\" src=\"2026-02-27zsjp335rlwh.png\" width=\"704\" \/><\/p>\n<h3>&#xff08;\u4e8c&#xff09;\u9489\u9489\u901a\u77e5<\/h3>\n<h4>1.\u914d\u7f6e\u9489\u9489<\/h4>\n<p>\u5efa\u7fa4\u4e4b\u540e\u52a0\u5165\u81ea\u5b9a\u4e49\u673a\u5668\u4eba&#xff1b;\u6839\u636e\u9700\u8981\u9009\u62e9\u5b89\u5168\u8bbe\u7f6e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"269\" src=\"2026-02-27d2rlc4rfiey.png\" width=\"638\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"545\" src=\"2026-02-272nhx44tjmse.png\" width=\"676\" \/><\/p>\n<p>\u4e0a\u9762\u4e24\u4e2a\u4fe1\u606f\u8981\u8bb0\u5f55\u597d\u9700\u8981\u914d\u7f6e\u5230jenkins\u4e2d<\/p>\n<h4>2.\u914d\u7f6ejenkins<\/h4>\n<p>\u5b89\u88c5 DingTalk \u63d2\u4ef6&#xff1b;\u5b89\u88c5\u5b8c\u63d2\u540e&#xff0c;\u5efa\u8bae\u91cd\u542f&#xff0c;\u5426\u5219\u53ef\u80fd\u901a\u77e5\u5931\u8d25<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"247\" src=\"2026-02-27musf1s0feaa.png\" width=\"599\" \/><\/p>\n<p>\u6dfb\u52a0\u4e00\u4e2a\u673a\u5668\u4eba&#xff0c;\u628a\u4e0a\u9762\u7684\u4e24\u4e2a\u4fe1\u606f\u653e\u5165\u5bf9\u5e94\u7684\u5730\u65b9<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"777\" src=\"2026-02-27xsantgx4pe3.png\" width=\"1290\" \/><\/p>\n<p>\u6d4b\u8bd5\u6210\u529f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"221\" src=\"2026-02-27steegpgsvsi.png\" width=\"492\" \/><\/p>\n<p>\u5230\u9879\u76ee\u7684\u914d\u7f6e\u4e2d\u521b\u5efa\u9489\u9489\u544a\u8b66<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"629\" src=\"2026-02-270nsk25aibuk.png\" width=\"1273\" \/><\/p>\n<p>\u6784\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"380\" src=\"2026-02-27pktcu22ji0o.png\" width=\"434\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"386\" src=\"2026-02-27idkhr0c0yg4.png\" width=\"450\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"638\" src=\"2026-02-27smjdsp4pykx.png\" width=\"1262\" \/><\/p>\n<h3>&#xff08;\u4e09&#xff09;\u4f01\u4e1a\u5fae\u4fe1<\/h3>\n<h4>1.\u548c\u9489\u9489\u5dee\u4e0d\u591a\u521b\u5efa\u673a\u5668\u4eba<\/h4>\n<h4>2.\u914d\u7f6ejenkins<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"226\" src=\"2026-02-27c3m5tf3r3t5.png\" width=\"1089\" \/><\/p>\n<p>\u8fdb\u5165\u4e00\u4e2a\u9879\u76ee\u914d\u7f6e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"480\" src=\"2026-02-27ddg4m4l5a24.png\" width=\"403\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"688\" src=\"2026-02-27tnkmdrqur5b.png\" width=\"1268\" \/><\/p>\n<h2>\u516d\u3001\u81ea\u52a8\u5316\u6784\u5efa<\/h2>\n<h3>&#xff08;\u4e00&#xff09;\u5b9a\u65f6\u548c SCM \u6784\u5efa<\/h3>\n<p>\u5b9a\u65f6\u6784\u5efa:<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6309\u65f6\u95f4\u5468\u671f\u6027\u7684\u89e6\u53d1\u6784\u5efa \u8f6e\u8be2SCM(Source Code Management): \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6307\u7684\u662f\u5b9a\u671f\u5230\u4ee3\u7801\u4ed3\u5e93\u68c0\u67e5\u4ee3\u7801\u662f\u5426\u6709\u53d8\u66f4&#xff0c;\u5b58\u5728\u4ee3\u7801\u53d8\u66f4\u65f6\u5c31\u8fd0\u884cpipeline;\u4e3a\u4e86\u80fd\u591f\u4eceCI\u4e2d\u5f97\u5230\u66f4\u591a\u7684\u6536\u76ca&#xff0c;\u8f6e\u8be2\u64cd\u4f5c\u8d8a\u9891\u7e41\u8d8a\u597d;\u663e\u7136&#xff0c;\u8fd9\u4f1a\u7ed9SCM\u5e26\u53bb\u65e0\u8c13\u7684\u538b\u529b,\u6240\u4ee5\u6784\u5efa\u7684\u89e6\u53d1\u7531SCM\u8d1f\u8d23\u901a\u77e5Jenkins\u6700\u4e3a\u7406\u60f3;\u4f46\u5728\u5916\u90e8\u7684SCM\u65e0\u6cd5\u901a\u77e5\u5230\u5c40\u57df\u7f51\u4e2d\u7684Jenkins\u65f6&#xff0c;\u53ef\u4ee5\u91c7\u8f6e\u8be2SCM\u65b9\u5f0f\u5012\u4e5f\u4e0d\u5931\u4e3a\u4e00\u79cd\u9009\u62e9<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u9996\u6b21\u4efb\u52a1\u4f1a\u8fdb\u884c\u6784\u5efa&#xff0c;\u540e\u7eed\u67e5\u770bSCM\u4ee3\u7801\u662f\u5426\u53d8\u5316&#xff0c;\u6765\u51b3\u5b9a\u662f\u5426\u6784\u5efa<\/p>\n<h4>1.\u5b9a\u65f6\u6784\u5efa<\/h4>\n<p>\u5b57\u6bb5\u8bf4\u660e<\/p>\n<ul>\n<li>\n<p>MINUTE&#xff1a;\u5c0f\u65f6\u5185\u7684\u5206\u949f\u6570&#xff08;\u53d6\u503c 0-59&#xff09;<\/p>\n<\/li>\n<li>\n<p>HOUR&#xff1a;\u4e00\u5929\u4e2d\u7684\u5c0f\u65f6\u6570&#xff08;\u53d6\u503c 0-23&#xff0c;24 \u5c0f\u65f6\u5236&#xff09;<\/p>\n<\/li>\n<li>\n<p>DOM&#xff1a;\u6bcf\u6708\u7684\u65e5\u671f&#xff08;\u53d6\u503c 1-31&#xff09;<\/p>\n<\/li>\n<li>\n<p>MONTH&#xff1a;\u6708\u4efd&#xff08;\u53d6\u503c 1-12&#xff09;<\/p>\n<\/li>\n<li>\n<p>DOW&#xff1a;\u6bcf\u5468\u7684\u661f\u671f\u51e0&#xff08;\u53d6\u503c 0-7&#xff0c;\u5176\u4e2d 0 \u548c 7 \u90fd\u4ee3\u8868\u5468\u65e5&#xff09;<\/p>\n<\/li>\n<\/ul>\n<p>\u64cd\u4f5c\u7b26\u8bf4\u660e<\/p>\n<p>\u8981\u4e3a\u5355\u4e2a\u5b57\u6bb5\u6307\u5b9a\u591a\u4e2a\u503c&#xff0c;\u53ef\u4f7f\u7528\u4ee5\u4e0b\u64cd\u4f5c\u7b26&#xff08;\u4f18\u5148\u7ea7\u6309\u987a\u5e8f\u6392\u5217&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\n<p>*&#xff1a;\u8868\u793a \u201c\u6240\u6709\u6709\u6548\u503c\u201d<\/p>\n<\/li>\n<li>\n<p>M-N&#xff1a;\u8868\u793a \u201c\u4e00\u4e2a\u503c\u7684\u8303\u56f4\u201d<\/p>\n<\/li>\n<li>\n<p>M-N\/X \u6216 *\/X&#xff1a;\u8868\u793a \u201c\u6309 X \u7684\u95f4\u9694&#xff0c;\u904d\u5386\u6307\u5b9a\u8303\u56f4\u6216\u6240\u6709\u6709\u6548\u503c\u201d<\/p>\n<\/li>\n<li>\n<p>A,B,\u2026,Z&#xff1a;\u8868\u793a \u201c\u679a\u4e3e\u591a\u4e2a\u503c\u201d<\/p>\n<\/li>\n<\/ul>\n<p>\u8d1f\u8f7d\u5747\u8861\u5efa\u8bae<\/p>\n<p>\u4e3a\u4e86\u8ba9\u5468\u671f\u6027\u4efb\u52a1\u7ed9\u7cfb\u7edf\u5e26\u6765\u66f4\u5747\u5300\u7684\u8d1f\u8f7d&#xff0c;\u5e94\u5c3d\u53ef\u80fd\u4f7f\u7528\u7b26\u53f7H&#xff08;\u5373 \u201c\u54c8\u5e0c\u201d \u7b26\u53f7&#xff09;\u3002\u4f8b\u5982&#xff1a;\u5982\u679c 12 \u4e2a\u65e5\u5e38\u4efb\u52a1\u90fd\u75280 0 * * *&#xff0c;\u4f1a\u5bfc\u81f4\u5348\u591c\u51fa\u73b0\u8d1f\u8f7d\u5cf0\u503c&#xff1b;\u800c\u7528H H * * *&#xff0c;\u6bcf\u4e2a\u4efb\u52a1\u4ecd\u4f1a\u6bcf\u5929\u6267\u884c\u4e00\u6b21&#xff0c;\u4f46\u4e0d\u4f1a\u540c\u65f6\u89e6\u53d1&#xff0c;\u80fd\u66f4\u597d\u5730\u5229\u7528\u6709\u9650\u8d44\u6e90\u3002<\/p>\n<p>H\u7b26\u53f7\u53ef\u7ed3\u5408\u8303\u56f4\u4f7f\u7528&#xff0c;\u4f8b\u5982H H(0-7) * * *\u8868\u793a\u5728\u51cc\u6668 0:00 \u5230 7:59 \u4e4b\u95f4\u7684\u67d0\u4e2a\u65f6\u95f4\u6267\u884c\u3002\u4f60\u4e5f\u53ef\u4ee5\u5728H\u4e2d\u7ed3\u5408\u95f4\u9694&#xff08;\u65e0\u8bba\u662f\u5426\u5e26\u8303\u56f4&#xff09;\u3002<\/p>\n<p>H\u7b26\u53f7\u53ef\u7406\u89e3\u4e3a \u201c\u8303\u56f4\u5185\u7684\u968f\u673a\u503c\u201d&#xff0c;\u4f46\u5b83\u5b9e\u9645\u4e0a\u662f\u57fa\u4e8e\u4f5c\u4e1a\u540d\u7684\u54c8\u5e0c\u503c&#xff08;\u800c\u975e\u968f\u673a\u51fd\u6570&#xff09;&#xff0c;\u56e0\u6b64\u5bf9\u6307\u5b9a\u9879\u76ee\u6765\u8bf4&#xff0c;\u8fd9\u4e2a\u503c\u662f\u7a33\u5b9a\u4e0d\u53d8\u7684\u3002<\/p>\n<p>\u6ce8\u610f\u4e8b\u9879<\/p>\n<p>\u5728 \u201c\u6bcf\u6708\u65e5\u671f\u201d \u5b57\u6bb5\u4e2d&#xff0c;\u77ed\u5468\u671f\u914d\u7f6e&#xff08;\u5982*\/3\u6216H\/3&#xff09;\u5728\u591a\u6570\u6708\u4efd\u7684\u6708\u672b\u4f1a\u51fa\u73b0\u6267\u884c\u4e0d\u4e00\u81f4\u7684\u60c5\u51b5&#xff08;\u56e0\u4e3a\u6708\u4efd\u5929\u6570\u4e0d\u540c&#xff09;\u3002\u4f8b\u5982&#xff1a;*\/3\u4f1a\u5728\u5929\u6570\u591a\u7684\u6708\u4efd\u91cc&#xff0c;\u5728 1 \u65e5\u30014 \u65e5\u2026\u202631 \u65e5\u6267\u884c&#xff0c;\u7136\u540e\u5728\u4e0b\u4e2a\u6708\u7684\u6b21\u65e5\u518d\u6b21\u6267\u884c&#xff1b;H\/3\u7684\u54c8\u5e0c\u503c\u59cb\u7ec8\u5728 1-28 \u8303\u56f4\u5185&#xff0c;\u56e0\u6b64\u6708\u672b\u7684\u6267\u884c\u95f4\u9694\u4f1a\u53d8\u6210 3 \u5230 6 \u5929&#xff08;\u957f\u5468\u671f\u914d\u7f6e\u4e5f\u4f1a\u6709\u95f4\u9694\u4e0d\u4e00\u81f4\u7684\u95ee\u9898&#xff0c;\u4f46\u5f71\u54cd\u76f8\u5bf9\u4e0d\u660e\u663e&#xff09;\u3002<\/p>\n<p>\u6ce8\u91ca\u89c4\u5219<\/p>\n<p>\u7a7a\u884c\u548c\u4ee5#\u5f00\u5934\u7684\u884c\u5c06\u88ab\u89c6\u4e3a\u6ce8\u91ca&#xff0c;\u4e0d\u4f1a\u88ab\u6267\u884c\u3002<\/p>\n<p>\u4fbf\u6377\u522b\u540d<\/p>\n<p>\u6b64\u5916&#xff0c;\u8fd8\u652f\u6301&#064;yearly\u3001&#064;annually\u3001&#064;monthly\u3001&#064;weekly\u3001&#064;daily\u3001&#064;midnight\u3001&#064;hourly\u8fd9\u4e9b\u4fbf\u6377\u522b\u540d&#xff0c;\u5b83\u4eec\u4f1a\u81ea\u52a8\u4f7f\u7528\u54c8\u5e0c\u7cfb\u7edf\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861&#xff1a;<\/p>\n<p>\u683c\u5f0f\u987a\u5e8f\u4e3a&#xff1a;\u5206\u949f \u5c0f\u65f6 \u65e5\u671f \u6708\u4efd \u661f\u671f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"531\" src=\"2026-02-2714evzemwf0g.png\" width=\"1309\" \/><\/p>\n<h4>2.SCM\u8f6e\u8be2\u6784\u5efa<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"341\" src=\"2026-02-27b0gyrspx2lp.png\" width=\"1312\" \/><\/p>\n<h3>&#xff08;\u4e8c&#xff09;\u6784\u5efa Webhook \u89e6\u53d1\u5668<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u6784\u5efa\u89e6\u53d1\u5668(webhook)&#xff0c;\u4e5f\u79f0\u4e3a\u94a9\u5b50&#xff0c;\u5b9e\u9645\u4e0a\u662f\u4e00\u4e2aHTTP\u56de\u8c03&#xff0c;\u5176\u7528\u4e8e\u5728\u5f00\u53d1\u4eba\u5458\u5411gitlab\u63d0\u4ea4\u4ee3\u7801\u540e\u80fd\u591f\u89e6\u53d1jenkins\u81ea\u52a8\u6267\u884c\u4ee3\u7801\u6784\u5efa\u64cd\u4f5c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"393\" src=\"2026-02-27yhziorwymuk.png\" width=\"1303\" \/><\/p>\n<p>\u6839\u636e\u63d0\u793a&#xff1a;JENKINS_URL\/job\/freestyle-spring-boot-helloworld-webhook\/build?token&#061;TOKEN_NAME \u5b8c\u5584\u8fd9\u4e2a\u5185\u5bb9&#xff1a;http:\/\/10.0.0.10:8080\/job\/freestyle-spring-boot-helloworld-webhook\/build?token&#061;123456<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"364\" src=\"2026-02-2743pfwok2nzw.png\" width=\"1094\" \/><\/p>\n<p>\u65b0\u5efa\u4e00\u4e2a\u8d26\u53f7<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"378\" src=\"2026-02-27p4roppm3fpj.png\" width=\"1633\" \/><\/p>\n<p>root&#064;ubuntu12:~  curl http:\/\/jenkins:123456&#064;10.0.0.10:8080\/job\/freestyle-spring-boot-helloworld-webhook\/build?token&#061;123456<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"153\" src=\"2026-02-27sizpbvqsfky.png\" width=\"451\" \/><\/p>\n<h4>1.\u00a0Jenkins \u914d\u7f6e\u751f\u6210\u7528\u6237\u7684 API Token<\/h4>\n<p>\u4e0d\u53ef\u80fd\u6bcf\u6b21\u90fd\u7528\u7528\u6237\u540d\u5bc6\u7801\u53bb\u6784\u5efa<\/p>\n<p>\u767b\u5f55\u521a\u624d\u521b\u5efa\u7684\u7528\u6237jenkins<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"627\" src=\"2026-02-27sfn0ojsy0b2.png\" width=\"1266\" \/><\/p>\n<p>\u628a\u8fd9\u4e2a\u5185\u5bb9\u6284\u4e0b\u6765<\/p>\n<p>root&#064;ubuntu12:~  curl http:\/\/jenkins:117483d551f8fab68e04ec5fb9b1ce4053&#064;10.0.0.10:8080\/job\/freestyle-spring-boot-helloworld-webhook\/build?token&#061;123456<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"116\" src=\"2026-02-27ensszyzgqp5.png\" width=\"379\" \/><\/p>\n<h4>2.\u914d\u7f6egitlab<\/h4>\n<p>\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u628a\u8fd9\u4e2a\u529f\u80fd\u6253\u5f00<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"772\" src=\"2026-02-27jeb2x5cnbb4.png\" width=\"1884\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"722\" src=\"2026-02-27xeshpgxye04.png\" width=\"909\" \/><\/p>\n<p>\u6d4b\u8bd5\u4e00\u4e0b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"393\" src=\"2026-02-271zp41vacgz2.png\" width=\"1365\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"204\" src=\"2026-02-27f3elmlotnlz.png\" width=\"504\" \/><\/p>\n<h2>\u4e03\u3001\u6784\u5efa\u524d\u540e\u591a\u4e2a\u9879\u76ee\u5173\u8054\u81ea\u52a8\u89e6\u53d1\u4efb\u52a1\u6267\u884c<\/h2>\n<p>\u521b\u5efa3\u4e2a\u65b0\u7684item&#xff1a;job1\u3001job2\u3001job3<\/p>\n<h3>&#xff08;\u4e00&#xff09;\u5728\u524d\u9762\u4efb\u52a1\u91cc\u914d\u7f6e\u6784\u5efa\u540e\u64cd\u4f5c<\/h3>\n<p>\u5728job1\u4e2d\u8bbe\u5b9a\u6784\u5efa\u5b8c\u6210\u540e\u542f\u52a8job2\u7684\u6784\u5efa\u529f\u80fd<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"454\" src=\"2026-02-27rs4fv1acwqw.png\" width=\"373\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"277\" src=\"2026-02-27z4gb2ix3gni.png\" width=\"495\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"229\" src=\"2026-02-272u0rd2ynrl4.png\" width=\"190\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"230\" src=\"2026-02-273igmlqdshek.png\" width=\"244\" \/><\/p>\n<h3>&#xff08;\u4e8c&#xff09;\u5728\u540e\u7eed\u6784\u5efa\u7684\u4efb\u52a1\u91cc\u5229\u7528\u6784\u5efa\u89e6\u53d1\u5668\u5b9e\u73b0<\/h3>\n<p>\u5728job3\u4e2d\u8bbe\u5b9a\u6784\u5efajob2\u540e\u81ea\u52a8\u6784\u5efajob3<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"541\" src=\"2026-02-274hdvu3qioks.png\" width=\"1040\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"279\" src=\"2026-02-27cwn1pldpdl5.png\" width=\"257\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"280\" src=\"2026-02-274gix0wkqq5m.png\" width=\"240\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"199\" src=\"2026-02-27yase2zv2ph0.png\" width=\"1289\" \/><\/p>\n<h2>\u516b\u3001\u5b9e\u73b0\u5bb9\u5668\u5316\u7684 Docker \u4efb\u52a1<\/h2>\n<h3>\u6d41\u7a0b\u601d\u8def<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"228\" src=\"2026-02-27s1hztm0prpm.png\" width=\"702\" \/><\/p>\n<h3>&#xff08;\u4e00&#xff09;\u67b6\u6784<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"547\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034317-69a112d5848e0.png\" width=\"583\" \/><\/p>\n<p>\u6211\u4eec\u9700\u8981\u572810.0.0.10\u3001 10.0.0.11\u3001 10.0.0.12 \u4e3b\u673a\u4e0a\u9762\u88c5\u4e0adocker&#xff1b;\u572810.0.0.10 \u4e3b\u673a\u4e0a\u642d\u5efa\u4e00\u4e2aharbor\u5b89\u88c5\u8fc7\u7a0b\u53ef\u4ee5\u53c2\u8003docker\u7b2c\u4e5d\u70b9\u7684harbor\u90e8\u7f72\u3002<\/p>\n<p>\u5199\u4e00\u4e2ahosts\u6587\u4ef6\u540c\u6b65\u523010.0.0.10\u3001 10.0.0.11\u3001 10.0.0.12 \u4e3b\u673a<\/p>\n<h4>1.\u6839\u636e\u6d41\u7a0b\u56fe\u5148\u4fee\u6539\u811a\u672c<\/h4>\n<p>root&#064;ubuntu10:~  cat \/data\/jenkins\/scripts\/spring-boot-helloworld.sh<br \/>\n#!\/bin\/bash<br \/>\nAPP&#061;spring-boot-helloworld<br \/>\n#APP_PATH&#061;\/data\/${APP}<\/p>\n<p># \u8fdc\u7a0b\u90e8\u7f72\u76ee\u6807\u4e3b\u673a\u5217\u8868<br \/>\nHOST_LIST&#061;&#034;<br \/>\n10.0.0.11<br \/>\n10.0.0.12<br \/>\n&#034;<br \/>\n# \u9879\u76ee\u8fd0\u884c\u7aef\u53e3<br \/>\nPORT&#061;80<br \/>\nHARBOR&#061;harbor.lty.org<br \/>\nPROJECT&#061;jenkins<br \/>\nTAG&#061;${BUILD_NUMBER}<\/p>\n<p>docker build -t ${HARBOR}\/${PROJECT}\/${APP}:${TAG} -f Dockerfile-multistages . <\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684item<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"356\" src=\"2026-02-27dldalggzeak.png\" width=\"798\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"718\" src=\"2026-02-27gh40ecar1l1.png\" width=\"1317\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"451\" src=\"2026-02-27ex4h4vc31vx.png\" width=\"1300\" \/><\/p>\n<p>\u5c1d\u8bd5\u6784\u5efa\u4e00\u4e0b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"169\" src=\"2026-02-27bsbrfm3jbhh.png\" width=\"1434\" \/><\/p>\n<p>\u63d0\u793a\u6743\u9650\u6709\u95ee\u9898<\/p>\n<p>root&#064;ubuntu10:~  ll \/var\/run\/docker.sock<br \/>\nsrw-rw&#8212;- 1 root docker 0  1\u6708 30 14:21 \/var\/run\/docker.sock&#061;         #660 \u6240\u6709\u4eba\u662f\u6ca1\u6709\u6743\u9650\u7684<\/p>\n<p>\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539jenkins\u7684\u914d\u7f6e\u6587\u4ef6\u8ba9\u4ed6\u7528root\u8eab\u4efd\u6267\u884c&#xff0c;\u4f46\u662f\u5904\u4e8e\u5b89\u5168\u8003\u8651\u4e0d\u91c7\u7528\u8fd9\u79cd\u65b9\u5f0f&#xff0c;\u6211\u4eec\u628ajenkins\u52a0\u5230docker\u7ec4\u4e2d<\/p>\n<p>root&#064;ubuntu10:~  usermod -aG docker jenkins<br \/>\nroot&#064;ubuntu10:~  id jenkins<br \/>\nuid&#061;123(jenkins) gid&#061;125(jenkins) \u7ec4&#061;125(jenkins),124(docker)<\/p>\n<p>\u6ce8\u610f\u4e00\u5b9a\u8981\u91cd\u542fjenkins\u624d\u80fd\u83b7\u53d6\u6700\u65b0\u7684\u7ec4\u6210\u5458\u5173\u7cfb<\/p>\n<p>systemctl restart jenkins <\/p>\n<p>\u6784\u5efa\u6210\u529f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"262\" src=\"2026-02-27kheykafemg0.png\" width=\"1039\" \/><\/p>\n<h4>2.\u4e0a\u4f20\u5230harbor\u4e0a<\/h4>\n<p>\u5bf9\u811a\u672c\u8fdb\u884c\u4fee\u6539<\/p>\n<p>root&#064;ubuntu10:~  cat \/data\/jenkins\/scripts\/spring-boot-helloworld.sh<br \/>\n#!\/bin\/bash<\/p>\n<p>APP&#061;spring-boot-helloworld<br \/>\n#APP_PATH&#061;\/data\/${APP}<\/p>\n<p># \u8fdc\u7a0b\u90e8\u7f72\u76ee\u6807\u4e3b\u673a\u5217\u8868<br \/>\nHOST_LIST&#061;&#034;<br \/>\n10.0.0.11<br \/>\n10.0.0.12<br \/>\n&#034;<br \/>\n# \u9879\u76ee\u8fd0\u884c\u7aef\u53e3<br \/>\nPORT&#061;80<br \/>\nHARBOR&#061;harbor.lty.org<br \/>\nPROJECT&#061;jenkins<br \/>\nTAG&#061;${BUILD_NUMBER}<\/p>\n<p>docker build -t ${HARBOR}\/${PROJECT}\/${APP}:${TAG} -f Dockerfile-multistages .<br \/>\ndocker login ${HARBOR} -u admin -p 123456            #\u767b\u5f55<br \/>\ndocker push ${HARBOR}\/${PROJECT}\/${APP}:${TAG}       #\u63a8\u9001\u5230harbor\u670d\u52a1\u5668<\/p>\n<p>\u6267\u884c\u6784\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"336\" src=\"2026-02-27wkcaqngk3sr.png\" width=\"807\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"334\" src=\"2026-02-27nl1sem5xauu.png\" width=\"1000\" \/><\/p>\n<p>\u5982\u679c\u6784\u5efa\u65f6\u51fa\u73b0https\u56e0\u4fe1\u4efb\u95ee\u9898\u62a5\u9519\u53ef\u4ee5\u4fee\u6539docker\u7684json\u6587\u4ef6&#xff0c;\u6ce8\u610f\u8981\u7ed9\u6bcf\u4e2a\u540e\u53f0\u4e3b\u673a\u4e5f\u4f20\u4e00\u4efd<\/p>\n<p>root&#064;ubuntu10:~ cat \/etc\/docker\/daemon.json<br \/>\n{<br \/>\n    &#034;registry-mirrors&#034;: [<br \/>\n        &#034;https:\/\/docker.m.daocloud.io&#034;,<br \/>\n        &#034;https:\/\/docker.1panel.live&#034;,<br \/>\n        &#034;https:\/\/docker.1ms.run&#034;,<br \/>\n        &#034;https:\/\/docker.xuanyuan.me&#034;<br \/>\n    ],<br \/>\n    &#034;experimental&#034;:true,<br \/>\n    &#034;insecure-registries&#034;: [&#034;harbor.lty.org&#034;]        #\u4e3b\u8981\u5c31\u662f\u52a0\u4e0a\u8fd9\u4e2a<br \/>\n}<\/p>\n<p>systemctl restart docker.service <\/p>\n<h4>3.\u540e\u7aef\u670d\u52a1\u5668\u8fd0\u884cdocker\u5bb9\u5668<\/h4>\n<p>\u5bf9\u811a\u672c\u8fdb\u884c\u4fee\u6539<\/p>\n<p>root&#064;ubuntu10:~# vim \/data\/jenkins\/scripts\/spring-boot-helloworld.sh<br \/>\n# \u9879\u76ee\u6838\u5fc3\u914d\u7f6e\u53d8\u91cf<br \/>\nAPP&#061;spring-boot-helloworld<br \/>\n#APP_PATH&#061;\/data\/${APP}<\/p>\n<p># \u8fdc\u7a0b\u90e8\u7f72\u76ee\u6807\u4e3b\u673a\u5217\u8868<br \/>\nHOST_LIST&#061;&#034;<br \/>\n10.0.0.11<br \/>\n10.0.0.12<br \/>\n&#034;<br \/>\n# \u9879\u76ee\u8fd0\u884c\u7aef\u53e3<br \/>\nPORT&#061;80<br \/>\nHARBOR&#061;harbor.lty.org<br \/>\nPROJECT&#061;jenkins<br \/>\nTAG&#061;${BUILD_NUMBER}<\/p>\n<p>docker build -t ${HARBOR}\/${PROJECT}\/${APP}:${TAG} -f Dockerfile-multistages .<br \/>\ndocker login ${HARBOR} -u admin -p 123456<br \/>\ndocker push ${HARBOR}\/${PROJECT}\/${APP}:${TAG}<\/p>\n<p># \u904d\u5386\u8fdc\u7a0b\u4e3b\u673a&#xff0c;\u6267\u884c\u6279\u91cf\u90e8\u7f72<br \/>\nfor host in ${HOST_LIST};do<br \/>\n    ssh root&#064;$host &#034;docker rm -f ${APP} &amp;&amp; docker run &#8211;name ${APP} -p ${PORT}:8888 -d ${HARBOR}\/${PROJECT}\/${APP}:${TAG}&#034;<br \/>\ndone<\/p>\n<p>\u6267\u884c\u6784\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"240\" src=\"2026-02-27u4lv3picfni.png\" width=\"1301\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"111\" src=\"2026-02-27priitzrccjl.png\" width=\"294\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"110\" src=\"2026-02-27gcgeqgq4olx.png\" width=\"377\" \/><\/p>\n<p>\u53ef\u4ee5\u5728\u5ba2\u6237\u673a\u6a21\u62df\u4e00\u4e0b\u4fee\u6539\u4ee3\u7801\u540e\u91cd\u65b0\u6784\u5efa<\/p>\n<p>root&#064;ubuntu14:~  vim \/spring-boot-helloworld\/src\/main\/java\/com\/neo\/controller\/HelloWorldController.java<br \/>\npackage com.neo.controller;<\/p>\n<p>import org.springframework.web.bind.annotation.RequestMapping;<br \/>\nimport org.springframework.web.bind.annotation.RestController;<\/p>\n<p>&#064;RestController<br \/>\npublic class HelloWorldController {<\/p>\n<p>    &#064;RequestMapping(&#034;\/&#034;)<br \/>\n    public String index() {<br \/>\n        return &#034;Spring Boot Hello\\\\n&#034;;<br \/>\n    }<\/p>\n<p>    &#064;RequestMapping(&#034;\/hello&#034;)<br \/>\n    public String hello() {<br \/>\n        return &#034;Hello World&#034;;<br \/>\n    }<\/p>\n<p>    &#064;RequestMapping(&#034;\/version&#034;)<br \/>\n    public String version() {<br \/>\n        return &#034;version v0.7\\\\n&#034;;            #\u6539\u6210v0.7\u7248<br \/>\n    }<br \/>\n}<\/p>\n<p>root&#064;ubuntu14:~\/spring-boot-helloworld   git commit -am &#039;v0.7&#039;<br \/>\n[main ff4f9cc] v0.7<br \/>\n 1 file changed, 1 insertion(&#043;), 1 deletion(-)<br \/>\nroot&#064;ubuntu14:~\/spring-boot-helloworld   git branch<br \/>\n* main<br \/>\nroot&#064;ubuntu14:~\/spring-boot-helloworld   git push &#8211;all<\/p>\n<p>\u91cd\u5efa\u6784\u5efa\u5bb9\u5668<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"282\" src=\"2026-02-27ltlcf33t2pe.png\" width=\"694\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"94\" src=\"2026-02-27vbktjy0igja.png\" width=\"305\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"94\" src=\"2026-02-27fu0w21j45l4.png\" width=\"299\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"342\" src=\"2026-02-27eyydiwv5bjk.png\" width=\"459\" \/><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jenkins \u662f\u57fa\u4e8e Java \u5f00\u53d1\u7684\u4e00\u79cd\u5f00\u6e90\u7684CI&#xff08;Continuous integration\u6301\u7eed\u96c6\u6210&#xff09;&amp;CD (Continuous\u00a0Delivery\u6301\u7eed\u4ea4\u4ed8&#xff0c;Continuous Deployment\u6301\u7eed\u90e8\u7f72)\u5de5\u5177<br \/>\n\u4e00\u3001\u00a0Jenkins \u5b89\u88c5\u548c\u542f\u52a8<br \/>\n&#xff08;\u4e00&#xff09;jenkins\u5b89\u88c5<br \/>\n1.\u73af\u5883\u51c6\u5907<br \/>\n\u7528\u54ea\u4e2a\u7248\u672c\u7684java\u73af\u5883\u4ece\u5b98\u7f51\u770b&#xff1a;https:\/\/www.jenkins.io\/doc\/<\/p>\n","protected":false},"author":2,"featured_media":78387,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[392,44],"topic":[],"class_list":["post-78407","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-jenkins","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CICD\u670d\u52a1\u5668jenkins - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/78407.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CICD\u670d\u52a1\u5668jenkins - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"Jenkins \u662f\u57fa\u4e8e Java \u5f00\u53d1\u7684\u4e00\u79cd\u5f00\u6e90\u7684CI&#xff08;Continuous integration\u6301\u7eed\u96c6\u6210&#xff09;&amp;CD (Continuous\u00a0Delivery\u6301\u7eed\u4ea4\u4ed8&#xff0c;Continuous Deployment\u6301\u7eed\u90e8\u7f72)\u5de5\u5177 \u4e00\u3001\u00a0Jenkins \u5b89\u88c5\u548c\u542f\u52a8 &#xff08;\u4e00&#xff09;jenkins\u5b89\u88c5 1.\u73af\u5883\u51c6\u5907 \u7528\u54ea\u4e2a\u7248\u672c\u7684java\u73af\u5883\u4ece\u5b98\u7f51\u770b&#xff1a;https:\/\/www.jenkins.io\/doc\/\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/78407.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-27T03:43:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034312-69a112d0b9488.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/78407.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/78407.html\",\"name\":\"CICD\u670d\u52a1\u5668jenkins - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-27T03:43:21+00:00\",\"dateModified\":\"2026-02-27T03:43:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/78407.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/78407.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/78407.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CICD\u670d\u52a1\u5668jenkins\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CICD\u670d\u52a1\u5668jenkins - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/78407.html","og_locale":"zh_CN","og_type":"article","og_title":"CICD\u670d\u52a1\u5668jenkins - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"Jenkins \u662f\u57fa\u4e8e Java \u5f00\u53d1\u7684\u4e00\u79cd\u5f00\u6e90\u7684CI&#xff08;Continuous integration\u6301\u7eed\u96c6\u6210&#xff09;&amp;CD (Continuous\u00a0Delivery\u6301\u7eed\u4ea4\u4ed8&#xff0c;Continuous Deployment\u6301\u7eed\u90e8\u7f72)\u5de5\u5177 \u4e00\u3001\u00a0Jenkins \u5b89\u88c5\u548c\u542f\u52a8 &#xff08;\u4e00&#xff09;jenkins\u5b89\u88c5 1.\u73af\u5883\u51c6\u5907 \u7528\u54ea\u4e2a\u7248\u672c\u7684java\u73af\u5883\u4ece\u5b98\u7f51\u770b&#xff1a;https:\/\/www.jenkins.io\/doc\/","og_url":"https:\/\/www.wsisp.com\/helps\/78407.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-27T03:43:21+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260227034312-69a112d0b9488.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"11 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/78407.html","url":"https:\/\/www.wsisp.com\/helps\/78407.html","name":"CICD\u670d\u52a1\u5668jenkins - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-27T03:43:21+00:00","dateModified":"2026-02-27T03:43:21+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/78407.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/78407.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/78407.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"CICD\u670d\u52a1\u5668jenkins"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/78407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=78407"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/78407\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/78387"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=78407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=78407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=78407"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=78407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}