{"id":25147,"date":"2023-04-23T17:40:37","date_gmt":"2023-04-23T09:40:37","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=25147"},"modified":"2023-04-23T17:40:37","modified_gmt":"2023-04-23T09:40:37","slug":"continuous-integration","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/continuous-integration.html","title":{"rendered":"\u8c08\u8c08\u6301\u7eed\u96c6\u6210\uff0c\u6301\u7eed\u4ea4\u4ed8\uff0c\u6301\u7eed\u90e8\u7f72\u4e4b\u95f4\u7684\u533a\u522b"},"content":{"rendered":"
<\/p>\n
\u5047\u5982\u628a\u5f00\u53d1\u5de5\u4f5c\u6d41\u7a0b\u5206\u4e3a\u4ee5\u4e0b\u51e0\u4e2a\u9636\u6bb5\uff1a<\/p>\n
\u7f16\u7801 -> \u6784\u5efa -> \u96c6\u6210 -> \u6d4b\u8bd5 -> \u4ea4\u4ed8 -> \u90e8\u7f72<\/p>\n
\u6b63\u5982\u4f60\u5728\u4e0a\u56fe\u4e2d\u770b\u5230\uff0c\u300c\u6301\u7eed\u96c6\u6210(Continuous Integration)\u300d\u3001\u300c\u6301\u7eed\u4ea4\u4ed8(Continuous Delivery)\u300d\u548c\u300c\u6301\u7eed\u90e8\u7f72(Continuous Deployment)\u300d\u6709\u7740\u4e0d\u540c\u7684\u8f6f\u4ef6\u81ea\u52a8\u5316\u4ea4\u4ed8\u5468\u671f\u3002<\/p>\n
\u6301\u7eed\u96c6\u6210\u662f\u6307\u8f6f\u4ef6\u4e2a\u4eba\u7814\u53d1\u7684\u90e8\u5206\u5411\u8f6f\u4ef6\u6574\u4f53\u90e8\u5206\u4ea4\u4ed8\uff0c\u9891\u7e41\u8fdb\u884c\u96c6\u6210\u4ee5\u4fbf\u66f4\u5feb\u5730\u53d1\u73b0\u5176\u4e2d\u7684\u9519\u8bef\u3002\u201c\u6301\u7eed\u96c6\u6210\u201d\u6e90\u81ea\u4e8e\u6781\u9650\u7f16\u7a0b(XP)\uff0c\u662f XP \u6700\u521d\u7684 12 \u79cd\u5b9e\u8df5\u4e4b\u4e00\u3002<\/p>\n
<\/p>\n
CI \u9700\u8981\u5177\u5907\u8fd9\u4e9b\uff1a<\/p>\n
\u6301\u7eed\u96c6\u6210\u7684\u4f18\u70b9<\/p>\n
\u6301\u7eed\u96c6\u6210\uff0c\u8be5\u4ece\u4f55\u5165\u624b<\/p>\n
\u6700\u91cd\u8981\u7684\u4e00\u73af\u662f\u9009\u62e9\u5408\u9002\u7684\u6301\u7eed\u96c6\u6210\u7cfb\u7edf\u3002\u662f\u642d\u5efa\u79c1\u6709\u90e8\u7f72\u8fd8\u662f\u9009\u62e9\u6258\u7ba1\u578b\u6301\u7eed\u96c6\u6210\u7cfb\u7edf\uff0c\u5173\u952e\u5728\u4e8e\u56e2\u961f\u8fd0\u884c\u7684\u57fa\u7840\u8bbe\u65bd\uff0c\u56e2\u961f\u5bf9\u6301\u7eed\u96c6\u6210\u7cfb\u7edf\u7684\u8d44\u6e90\u6295\u5165\u529b\u5ea6\u3002<\/p>\n
\u5bf9\u6bd4\u4e00\u4e0b\u79c1\u6709\u90e8\u7f72\u548c\u6258\u7ba1\u578b\u6301\u7eed\u96c6\u6210\u7cfb\u7edf\uff0c\u6216\u8bb8\u80fd\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u505a\u51fa\u9009\u62e9\u3002<\/p>\n
\u6574\u4f53\u800c\u8a00\uff0cJenkins \u8fc7\u53bb\u4e00\u76f4\u662f\u5927\u90e8\u5206\u516c\u53f8\u7684\u9009\u62e9\uff0c\u4f46\u8fd9\u4e2a\u73b0\u8c61\u6b63\u5728\u53d1\u751f\u6539\u53d8\uff0c\u968f\u7740\u516c\u6709\u4e91\u670d\u52a1\u3001Docker\uff0cSaaS \u7684\u666e\u53ca\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u4f01\u4e1a\u5f00\u59cb\u9009\u62e9 Hosted CI\uff0c\u4e5f\u5c31\u662f\u6258\u7ba1\u578b\u6301\u7eed\u96c6\u6210\u7cfb\u7edf\u3002<\/p>\n
\u53e6\u5916\uff0c\u5728\u9009\u62e9\u5408\u9002\u7684\u6301\u7eed\u96c6\u6210\u670d\u52a1\u65f6\uff0c\u8fd8\u9700\u8981\u8003\u91cf\u7cfb\u7edf\u7684\u7075\u6d3b\u5ea6\u4ee5\u9002\u5e94\u516c\u53f8\u4e0d\u540c\u9636\u6bb5\u7684\u5f00\u53d1\u6d4b\u8bd5\u9700\u6c42\u3002<\/p>\n
\u9009\u62e9\u6301\u7eed\u96c6\u6210\u7cfb\u7edf\u53ea\u662f\u6301\u7eed\u96c6\u6210\u5e94\u7528\u7684\u5176\u4e2d\u4e00\u6b65\uff0c\u8fd8\u9700\u8981\u5efa\u7acb\u5408\u9002\u7684\u6301\u7eed\u96c6\u6210\u6587\u5316\u6bd4\u5982\u4ee3\u7801\u8d28\u91cf\u7ba1\u63a7\u3001\u6d4b\u8bd5\u6587\u5316\u7b49\u3002\u505a\u597d\u6301\u7eed\u96c6\u6210\uff0c\u53ef\u4e3a\u6301\u7eed\u4ea4\u4ed8\u4e0e\u6301\u7eed\u90e8\u7f72\u6253\u597d\u575a\u5b9e\u57fa\u7840\u3002<\/p>\n
\u6301\u7eed\u4ea4\u4ed8\u5728\u6301\u7eed\u96c6\u6210\u7684\u57fa\u7840\u4e0a\uff0c\u5c06\u96c6\u6210\u540e\u7684\u4ee3\u7801\u90e8\u7f72\u5230\u66f4\u8d34\u8fd1\u771f\u5b9e\u8fd0\u884c\u73af\u5883\u7684\u300c\u7c7b\u751f\u4ea7\u73af\u5883\u300d(production-like environments)\u4e2d\u3002\u6301\u7eed\u4ea4\u4ed8\u4f18\u5148\u4e8e\u6574\u4e2a\u4ea7\u54c1\u751f\u547d\u5468\u671f\u7684\u8f6f\u4ef6\u90e8\u7f72\uff0c\u5efa\u7acb\u5728\u9ad8\u6c34\u5e73\u81ea\u52a8\u5316\u6301\u7eed\u96c6\u6210\u4e4b\u4e0a\u3002<\/p>\n
<\/p>\n
\u8bd5\u60f3\u60f3\uff0c\u5982\u679c\u8bf4\u7b49\u5230\u6240\u6709\u4e1c\u897f\u90fd\u5b8c\u6210\u4e86\u624d\u5411\u4e0b\u4e2a\u73af\u8282\u4ea4\u4ed8\uff0c\u5bfc\u81f4\u6240\u6709\u7684\u95ee\u9898\u53ea\u80fd\u518d\u6700\u540e\u624d\u7206\u53d1\u51fa\u6765\uff0c\u89e3\u51b3\u6210\u672c\u5de8\u5927\u751a\u81f3\u65e0\u6cd5\u89e3\u51b3\u3002\u6bd4\u5982\uff0c\u6211\u4eec\u5b8c\u6210\u5355\u5143\u6d4b\u8bd5\u540e\uff0c\u53ef\u4ee5\u628a\u4ee3\u7801\u90e8\u7f72\u5230\u8fde\u63a5\u6570\u636e\u5e93\u7684 Staging \u73af\u5883\u4e2d\u8fdb\u884c\u66f4\u591a\u7684\u81ea\u52a8\u5316\u6d4b\u8bd5\u3002\u5982\u679c\u4ee3\u7801\u6ca1\u6709\u95ee\u9898\uff0c\u53ef\u4ee5\u7ee7\u7eed\u624b\u52a8\u90e8\u7f72\u5230\u751f\u4ea7\u73af\u5883\u4e2d\u3002\u5f53\u7136\uff0c\u6301\u7eed\u4ea4\u4ed8\u5e76\u4e0d\u662f\u6307\u8f6f\u4ef6\u6bcf\u4e00\u4e2a\u6539\u52a8\u90fd\u8981\u5c3d\u5feb\u90e8\u7f72\u5230\u4ea7\u54c1\u73af\u5883\u4e2d\uff0c\u5b83\u6307\u7684\u662f\u4efb\u4f55\u7684\u4ee3\u7801\u4fee\u6539\u90fd\u53ef\u4ee5\u5728\u4efb\u4f55\u65f6\u5019\u5b9e\u65bd\u90e8\u7f72\u3002<\/p>\n
\u6301\u7eed\u4ea4\u4ed8\u7684\u597d\u5904<\/p>\n
\u6301\u7eed\u4ea4\u4ed8\u548c\u6301\u7eed\u96c6\u6210\u7684\u4f18\u70b9\u975e\u5e38\u76f8\u4f3c\uff1a<\/p>\n
\u6301\u7eed\u90e8\u7f72\u662f\u6307\u5f53\u4ea4\u4ed8\u7684\u4ee3\u7801\u901a\u8fc7\u8bc4\u5ba1\u4e4b\u540e\uff0c\u81ea\u52a8\u90e8\u7f72\u5230\u751f\u4ea7\u73af\u5883\u4e2d\u3002\u6301\u7eed\u90e8\u7f72\u662f\u6301\u7eed\u4ea4\u4ed8\u7684\u6700\u9ad8\u9636\u6bb5\u3002\u8fd9\u610f\u5473\u7740\uff0c\u6240\u6709\u901a\u8fc7\u4e86\u4e00\u7cfb\u5217\u7684\u81ea\u52a8\u5316\u6d4b\u8bd5\u7684\u6539\u52a8\u90fd\u5c06\u81ea\u52a8\u90e8\u7f72\u5230\u751f\u4ea7\u73af\u5883\u3002\u5b83\u4e5f\u53ef\u4ee5\u88ab\u79f0\u4e3a\u201cContinuous Release\u201d\u3002<\/p>\n
<\/p>\n
\u4e3a\u4ec0\u4e48\u8bf4\u6301\u7eed\u90e8\u7f72\u662f\u7406\u60f3\u7684\u5de5\u4f5c\u6d41\u7a0b?<\/strong><\/p>\n \u201c\u5f00\u53d1\u4eba\u5458\u63d0\u4ea4\u4ee3\u7801\uff0c\u6301\u7eed\u96c6\u6210\u670d\u52a1\u5668\u83b7\u53d6\u4ee3\u7801\uff0c\u6267\u884c\u5355\u5143\u6d4b\u8bd5\uff0c\u6839\u636e\u6d4b\u8bd5\u7ed3\u679c\u51b3\u5b9a\u662f\u5426\u90e8\u7f72\u5230\u9884\u6f14\u73af\u5883\uff0c\u5982\u679c\u6210\u529f\u90e8\u7f72\u5230\u9884\u6f14\u73af\u5883\uff0c\u8fdb\u884c\u6574\u4f53\u9a8c\u6536\u6d4b\u8bd5\uff0c\u5982\u679c\u6d4b\u8bd5\u901a\u8fc7\uff0c\u81ea\u52a8\u90e8\u7f72\u5230\u4ea7\u54c1\u73af\u5883\uff0c\u5168\u7a0b\u81ea\u52a8\u5316\u9ad8\u6548\u8fd0\u8f6c\u3002\u201d<\/p>\n \u5b9e\u9645\u4e0a\uff0c\u4ea7\u54c1\u5728\u4ece\u9700\u6c42\u5230\u90e8\u7f72\u7684\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u7ecf\u5386\u82e5\u5e72\u79cd\u4e0d\u540c\u7684\u73af\u5883\uff0c\u4f8b\u5982 QA \u73af\u5883\u3001\u5404\u79cd\u81ea\u52a8\u5316\u6d4b\u8bd5\u8fd0\u884c\u73af\u5883\u3001\u751f\u4ea7\u73af\u5883\u7b49\u3002\u8fd9\u4e9b\u73af\u5883\u7684\u642d\u5efa\u3001\u914d\u7f6e\u3001\u7ba1\u7406\uff0c\u4ea7\u54c1\u5728\u4e0d\u540c\u73af \u5883\u4e2d\u7684\u5177\u4f53\u90e8\u7f72\uff0c\u72b6\u51b5\u662f\u6bd4\u8f83\u975e\u5e38\u590d\u6742\u7684\uff0c\u4ece\u5934\u5230\u5c3e\u5730\u5168\u81ea\u52a8\u6301\u7eed\u90e8\u7f72\u7684\u786e\u56f0\u96be\u3002\u90a3\u4e48\uff0c\u5982\u679c\u80fd\u505a\u5230\u6301\u7eed\u4ea4\u4ed8\uff0c\u4fdd\u8bc1\u4ee3\u7801\u5728\u6a21\u62df\u73af\u5883\u6ca1\u95ee\u9898\uff0c\u4e5f\u8bb8\u56e2\u961f\u6210\u5458\u505a\u5230\u771f\u6b63\u7684\u5fc3\u7406\u6709\u6570\u3002<\/p>\n \u6301\u7eed\u90e8\u7f72\u7684\u4f18\u70b9<\/p>\n \u6301\u7eed\u90e8\u7f72\u4e3b\u8981\u597d\u5904\u662f\uff0c\u53ef\u4ee5\u76f8\u5bf9\u72ec\u7acb\u5730\u90e8\u7f72\u65b0\u7684\u529f\u80fd\uff0c\u5e76\u80fd\u5feb\u901f\u5730\u6536\u96c6\u771f\u5b9e\u7528\u6237\u7684\u53cd\u9988\u3002<\/p>\n \u201cYou build it, you run it\u201d\uff0c\u8fd9\u662f Amazon \u4e00\u5e74\u53ef\u4ee5\u5b8c\u6210 5000 \u4e07\u6b21\u90e8\u7f72\uff0c\u5e73\u5747\u6bcf\u4e2a\u5de5\u7a0b\u5e08\u6bcf\u5929\u90e8\u7f72\u8d85\u8fc7 50 \u6b21\u7684\u6838\u5fc3\u79d8\u7c4d\u3002<\/p>\n \u300c\u6301\u7eed\u96c6\u6210(Continuous Integration)\u300d\u3001\u300c\u6301\u7eed\u4ea4\u4ed8(Continuous Delivery)\u300d\u548c\u300c\u6301\u7eed\u90e8\u7f72(Continuous Deployment)\u300d\u63d0\u4f9b\u4e86\u4e00\u4e2a\u4f18\u79c0\u7684 DevOps \u73af\u5883\uff0c\u5bf9\u4e8e\u6574\u4e2a\u56e2\u961f\u6765\u8bf4\uff0c\u597d\u5904\u4e0e\u6311\u6218\u5e76\u884c\u3002\u65e0\u8bba\u5982\u4f55\uff0c\u9891\u7e41\u90e8\u7f72\u3001\u5feb\u901f\u4ea4\u4ed8\u4ee5\u53ca\u5f00\u53d1\u6d4b\u8bd5\u6d41\u7a0b\u81ea\u52a8\u5316\u90fd\u5c06\u6210\u4e3a\u672a\u6765\u8f6f\u4ef6\u5de5\u7a0b\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\u3002<\/p>\n \u6b22\u8fce\u5206\u4eab\u4f60\u7684\u89c2\u70b9\u3002<\/p>\n \u539f\u6587\u6765\u81ea\uff1ahttp:\/\/os.51cto.com\/art\/201608\/515625.htm<\/a><\/p>\n\n