{"id":129990,"date":"2018-12-06T09:50:00","date_gmt":"2018-12-06T01:50:00","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=129990"},"modified":"2018-12-05T09:50:58","modified_gmt":"2018-12-05T01:50:58","slug":"infrastructure-ci","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/infrastructure-ci.html","title":{"rendered":"\u8ba9\u57fa\u7840\u8bbe\u65bd\u53d8\u6210CI\u6d41\u7a0b\u4e2d\u7684\u4e00\u73af"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u60f3\u8981\u63d0\u5347\u4f60\u7684 DevOps \u6548\u7387\u5417\uff1f\u5c06\u57fa\u7840\u8bbe\u65bd\u5f53\u6210\u4f60\u7684 CI \u6d41\u7a0b\u4e2d\u7684\u91cd\u8981\u7684\u4e00\u73af\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u6301\u7eed\u4ea4\u4ed8\uff08CD\uff09\u548c\u6301\u7eed\u96c6\u6210\uff08CI\uff09\u662f DevOps \u7684\u4e24\u4e2a\u4f17\u6240\u5468\u77e5\u7684\u65b9\u9762\u3002\u4f46\u5728 CI \u5927\u8086\u6d41\u884c\u7684\u4eca\u5929\u5374\u5ffd\u7565\u4e86\u53e6\u4e00\u4e2a\u5173\u952e\u6027\u7684 I\uff1a\u57fa\u7840\u8bbe\u65bdinfrastructure\u3002<\/p>\n \u66fe\u7ecf\u6709\u4e00\u6bb5\u65f6\u95f4 \u201c\u57fa\u7840\u8bbe\u65bd\u201d\u5c31\u610f\u5473\u7740\u65e0\u5934headless\u7684\u9ed1\u76d2\u5b50\u3001\u5e9e\u5927\u7684\u670d\u52a1\u5668\uff0c\u548c\u9ad8\u8038\u7684\u673a\u67b6 \u2014\u2014 \u66f4\u4e0d\u7528\u8bf4\u6f2b\u957f\u7684\u91c7\u8d2d\u6d41\u7a0b\u548c\u5bf9\u76c8\u4f59\u8d1f\u8f7d\u7684\u9519\u8bef\u4f30\u8ba1\u3002\u540e\u6765\u5230\u4e86\u865a\u62df\u673a\u65f6\u4ee3\uff0c\u628a\u57fa\u7840\u8bbe\u65bd\u5904\u7406\u5f97\u5f88\u597d\uff0c\u865a\u62df\u5316 \u2014\u2014 \u4ee5\u524d\u7684\u4e16\u754c\u4ece\u672a\u6709\u8fc7\u8fd9\u6837\u3002\u6211\u4eec\u4e0d\u518d\u9700\u8981\u7ba1\u7406\u5b9e\u4f53\u7684\u670d\u52a1\u5668\u3002\u4ec5\u4ec5\u662f\u7b80\u5355\u7684\u70b9\u51fb\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u521b\u5efa\u548c\u9500\u6bc1\u3001\u5f00\u59cb\u548c\u505c\u6b62\u3001\u5347\u7ea7\u548c\u964d\u7ea7\u6211\u4eec\u7684\u670d\u52a1\u5668\u3002<\/p>\n \u6709\u4e00\u4e2a\u5173\u4e8e\u94f6\u884c\u7684\u6d41\u884c\u6545\u4e8b\uff1a\u5b83\u4eec\u5b9e\u73b0\u4e86\u6570\u5b57\u5316\uff0c\u5e76\u4e14\u5f15\u5165\u4e86\u5728\u7ebf\u8868\u683c\uff0c\u7528\u6237\u9700\u8981\u624b\u52a8\u586b\u5199\u8868\u683c\u3001\u6253\u5370\uff0c\u7136\u540e\u90ae\u5bc4\u56de\u94f6\u884c\uff08LCTT \u8bd1\u6ce8\uff1a\u6211\u771f\u7684\u9047\u5230\u8fc7\u6709\u4eba\u95ee\u6211\u8fd9\u6837\u7684\u9700\u6c42\u600e\u4e48\u529e\uff09\u3002\u8fd9\u5c31\u662f\u6211\u4eec\u4eca\u5929\u57fa\u7840\u8bbe\u65bd\u9047\u5230\u7684\u60c5\u51b5\uff1a\u4f7f\u7528\u65b0\u6280\u672f\u6765\u505a\u548c\u4ee5\u524d\u4e00\u6837\u7684\u4e8b\u60c5\u3002<\/p>\n \u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u4f1a\u770b\u5230\u5728\u57fa\u7840\u8bbe\u65bd\u7ba1\u7406\u65b9\u9762\u7684\u8fdb\u6b65\uff0c\u5c06\u57fa\u7840\u8bbe\u65bd\u89c6\u4e3a\u4e00\u4e2a\u7248\u672c\u5316\u7684\u7ec4\u4ef6\u5e76\u8bd5\u7740\u63a2\u7d22\u4e0d\u53ef\u53d8\u670d\u52a1\u5668immutable server\u7684\u6982\u5ff5\u3002\u5728\u540e\u9762\u7684\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u4e86\u89e3\u5982\u4f55\u4f7f\u7528\u5f00\u6e90\u5de5\u5177\u6765\u5b9e\u73b0\u6301\u7eed\u7684\u57fa\u7840\u8bbe\u65bd\u3002<\/p>\n
\u7a81\u51fb\u5c0f\u6d4b\u8bd5\uff1a<\/p>\n \u4f60\u600e\u6837\u521b\u5efa\u548c\u5347\u7ea7\u4f60\u7684\u57fa\u7840\u8bbe\u65bd\uff1f \u4ee3\u7801<\/p>\n \u901a\u8fc7\u4ee3\u7801\u6765\u521b\u5efa\u57fa\u7840\u8bbe\u65bd\u67b6\u6784\uff0c\u800c\u4e0d\u662f\u901a\u8fc7\u5b89\u88c5\u3002\u57fa\u7840\u8bbe\u65bd\u5982\u4ee3\u7801Infrastructure as code\uff08IaC\uff09\u662f\u4f7f\u7528\u914d\u7f6e\u811a\u672c\u521b\u5efa\u57fa\u7840\u8bbe\u65bd\u7684\u73b0\u4ee3\u6700\u6d41\u884c\u7684\u65b9\u6cd5\u3002\u8fd9\u4e9b\u811a\u672c\u9075\u5faa\u5178\u578b\u7684\u7f16\u7801\u548c\u5355\u5143\u6d4b\u8bd5\u5468\u671f\uff08\u8bf7\u53c2\u9605\u4e0b\u9762\u5173\u4e8e Terraform \u811a\u672c\u7684\u793a\u4f8b\uff09\u3002<\/p>\n \u7248\u672c<\/p>\n IaC \u7ec4\u4ef6\u5728\u6e90\u7801\u4ed3\u5e93\u4e2d\u8fdb\u884c\u7248\u672c\u7ba1\u7406\u3002\u8fd9\u8ba9\u57fa\u7840\u8bbe\u65bd\u7684\u62e5\u6709\u4e86\u7248\u672c\u63a7\u5236\u7684\u6240\u6709\u597d\u5904\uff1a\u4e00\u81f4\u6027\uff0c\u53ef\u8ffd\u6eaf\u6027\uff0c\u5206\u652f\u548c\u6807\u8bb0\u3002<\/p>\n \u7ba1\u7406<\/p>\n \u901a\u8fc7\u7f16\u7801\u548c\u7248\u672c\u5316\u7684\u57fa\u7840\u8bbe\u65bd\u7ba1\u7406\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4f60\u6240\u719f\u6089\u7684\u6d4b\u8bd5\u548c\u53d1\u5e03\u6d41\u7a0b\u6765\u7ba1\u7406\u57fa\u7840\u8bbe\u65bd\u7684\u5f00\u53d1\u3002<\/p>\n CIi \u63d0\u4f9b\u4e86\u4e0b\u9762\u7684\u8fd9\u4e9b\u4f18\u52bf\uff1a<\/p>\n \u4e00\u81f4\u6027Consistency<\/p>\n \u7248\u672c\u5316\u548c\u6807\u8bb0\u5316\u7684\u57fa\u7840\u8bbe\u65bd\u610f\u5473\u7740\u4f60\u53ef\u4ee5\u6e05\u695a\u7684\u77e5\u9053\u4f60\u7684\u7cfb\u7edf\u4f7f\u7528\u4e86\u54ea\u4e9b\u7ec4\u4ef6\u548c\u914d\u7f6e\u3002\u8fd9\u5efa\u7acb\u4e86\u4e00\u4e2a\u975e\u5e38\u597d\u7684 DevOps \u5b9e\u8df5\uff0c\u7528\u6765\u9274\u522b\u548c\u7ba1\u7406\u57fa\u7840\u8bbe\u65bd\u7684\u4e00\u81f4\u6027\u3002<\/p>\n \u53ef\u91cd\u73b0\u6027Reproducibility<\/p>\n \u901a\u8fc7\u57fa\u7840\u8bbe\u65bd\u7684\u6807\u8bb0\u548c\u57fa\u7ebf\uff0c\u91cd\u5efa\u57fa\u7840\u8bbe\u65bd\u53d8\u5f97\u975e\u5e38\u5bb9\u6613\u3002\u60f3\u60f3\u4f60\u662f\u5426\u7ecf\u5e38\u542c\u5230\u8fd9\u4e2a\uff1a\u201c\u4f46\u662f\u5b83\u5728\u6211\u7684\u673a\u5668\u4e0a\u53ef\u4ee5\u8fd0\u884c\uff01\u201d\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u5728\u672c\u5730\u7684\u6d4b\u8bd5\u5e73\u53f0\u4e2d\u5feb\u901f\u91cd\u73b0\u7c7b\u4f3c\u751f\u4ea7\u73af\u5883\uff0c\u4ece\u800c\u5c06\u73af\u5883\u50cf\u53d8\u91cf\u4e00\u6837\u5728\u4f60\u7684\u8c03\u8bd5\u8fc7\u7a0b\u4e2d\u5220\u9664\u3002<\/p>\n \u53ef\u8ffd\u6eaf\u6027Traceability<\/p>\n \u4f60\u662f\u5426\u8fd8\u8bb0\u5f97\u66fe\u7ecf\u6709\u8fc7\u591a\u5c11\u6b21\u5bfb\u627e\u5230\u5e95\u662f\u8c01\u66f4\u6539\u4e86\u6587\u4ef6\u5939\u6743\u9650\u7684\u7ecf\u5386\uff0c\u6216\u8005\u662f\u8c01\u5347\u7ea7\u4e86 ssh <\/span>\u5305\uff1f\u4ee3\u7801\u5316\u7684\u3001\u7248\u672c\u5316\u7684\uff0c\u53d1\u5e03\u7684\u57fa\u7840\u8bbe\u65bd\u6d88\u9664\u4e86\u4e34\u65f6\u6027\u53d8\u66f4\uff0c\u4e3a\u57fa\u7840\u8bbe\u65bd\u7684\u7ba1\u7406\u5e26\u6765\u4e86\u53ef\u8ffd\u8e2a\u6027\u548c\u53ef\u9884\u6d4b\u6027\u3002<\/p>\n \u81ea\u52a8\u5316Automation<\/p>\n \u501f\u52a9\u811a\u672c\u5316\u7684\u57fa\u7840\u67b6\u6784\uff0c\u81ea\u52a8\u5316\u662f\u4e0b\u4e00\u4e2a\u5408\u4e4e\u903b\u8f91\u7684\u6b65\u9aa4\u3002\u81ea\u52a8\u5316\u5141\u8bb8\u4f60\u6309\u9700\u521b\u5efa\u57fa\u7840\u8bbe\u65bd\uff0c\u5e76\u5728\u4f7f\u7528\u5b8c\u6210\u540e\u9500\u6bc1\u5b83\uff0c\u6240\u4ee5\u4f60\u53ef\u4ee5\u5c06\u66f4\u591a\u5b9d\u8d35\u7684\u65f6\u95f4\u548c\u7cbe\u529b\u7528\u5728\u66f4\u91cd\u8981\u7684\u4efb\u52a1\u4e0a\u3002<\/p>\n \u4e0d\u53d8\u6027Immutability<\/p>\n CIi \u5e26\u6765\u4e86\u4e0d\u53ef\u53d8\u57fa\u7840\u8bbe\u65bd\u7b49\u521b\u65b0\u3002\u4f60\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u57fa\u7840\u8bbe\u65bd\u7ec4\u4ef6\u800c\u4e0d\u662f\u901a\u8fc7\u5347\u7ea7\uff08\u8bf7\u53c2\u9605\u4e0b\u9762\u6709\u5173\u4e0d\u53ef\u53d8\u8bbe\u65bd\u7684\u8bf4\u660e\uff09\u3002<\/p>\n \u6301\u7eed\u57fa\u7840\u8bbe\u65bd\u662f\u4ece\u8fd0\u884c\u57fa\u7840\u73af\u5883\u5230\u8fd0\u884c\u57fa\u7840\u7ec4\u4ef6\u7684\u8fdb\u5316\u3002\u50cf\u5904\u7406\u4ee3\u7801\u4e00\u6837\uff0c\u901a\u8fc7\u8bc1\u5b9e\u7684 DevOps \u6d41\u7a0b\u6765\u5b8c\u6210\u3002\u5bf9\u4f20\u7edf\u7684 CI \u7684\u91cd\u65b0\u5b9a\u4e49\u5305\u542b\u4e86\u7f3a\u5c11\u7684\u90a3\u4e2a \u201ci\u201d\uff0c\u4ece\u800c\u5f62\u6210\u4e86\u8fde\u8d2f\u7684 CD \u3002<\/p>\n (CIc + CIi) = CI -> CD<\/p>\n Ii \u6d41\u7a0b\u7684\u4e00\u4e2a\u5173\u952e\u63a8\u52a8\u56e0\u7d20\u662f\u57fa\u7840\u8bbe\u65bd\u5982\u4ee3\u7801infrastructure as code\uff08IaC\uff09\u3002IaC \u662f\u4e00\u79cd\u4f7f\u7528\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u57fa\u7840\u8bbe\u65bd\u521b\u5efa\u548c\u5347\u7ea7\u7684\u673a\u5236\u3002\u8fd9\u4e9b\u914d\u7f6e\u6587\u4ef6\u50cf\u5176\u4ed6\u7684\u4ee3\u7801\u4e00\u6837\u8fdb\u884c\u5f00\u53d1\uff0c\u5e76\u4e14\u4f7f\u7528\u7248\u672c\u7ba1\u7406\u7cfb\u7edf\u8fdb\u884c\u7ba1\u7406\u3002\u8fd9\u4e9b\u6587\u4ef6\u9075\u5faa\u4e00\u822c\u7684\u4ee3\u7801\u5f00\u53d1\u6d41\u7a0b\uff1a\u5355\u5143\u6d4b\u8bd5\u3001\u63d0\u4ea4\u3001\u6784\u5efa\u548c\u53d1\u5e03\u3002IaC \u6d41\u7a0b\u62e5\u6709\u7248\u672c\u63a7\u5236\u5e26\u7ed9\u57fa\u7840\u8bbe\u65bd\u5f00\u53d1\u7684\u6240\u6709\u597d\u5904\uff0c\u5982\u6807\u8bb0\u3001\u7248\u672c\u4e00\u81f4\u6027\uff0c\u548c\u4fee\u6539\u53ef\u8ffd\u6eaf\u3002<\/p>\n \u8fd9\u6709\u4e00\u4e2a\u7b80\u5355\u7684 Terraform \u811a\u672c\u7528\u6765\u5728 AWS \u4e0a\u521b\u5efa\u4e00\u4e2a\u53cc\u5c42\u57fa\u7840\u8bbe\u65bd\u7684\u7b80\u5355\u793a\u4f8b\uff0c\u5305\u62ec\u865a\u62df\u79c1\u6709\u4e91\uff08VPC\uff09\u3001\u5f39\u6027\u8d1f\u8f7d\uff08ELB\uff09\uff0c\u5b89\u5168\u7ec4\u548c\u4e00\u4e2a NGINX \u670d\u52a1\u5668\u3002Terraform \u662f\u4e00\u4e2a\u901a\u8fc7\u811a\u672c\u521b\u5efa\u548c\u66f4\u6539\u57fa\u7840\u8bbe\u65bd\u67b6\u6784\u548c\u5f00\u6e90\u5de5\u5177\u3002<\/p>\n \u4f60\u6709\u51e0\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u865a\u62df\u673a\uff0c\u9700\u8981\u66f4\u65b0\u5b89\u5168\u8865\u4e01\u3002\u4e00\u4e2a\u5e38\u89c1\u7684\u505a\u6cd5\u662f\u63a8\u9001\u4e00\u4e2a\u8fdc\u7a0b\u811a\u672c\u5355\u72ec\u66f4\u65b0\u6bcf\u4e2a\u7cfb\u7edf\u3002<\/p>\n \u8981\u662f\u4e0d\u66f4\u65b0\u65e7\u7cfb\u7edf\uff0c\u5982\u4f55\u624d\u80fd\u76f4\u63a5\u4e22\u5f03\u5b83\u4eec\u5e76\u90e8\u7f72\u5b89\u88c5\u4e86\u65b0\u5b89\u5168\u8865\u4e01\u7684\u65b0\u7cfb\u7edf\u5462\uff1f\u8fd9\u5c31\u662f\u4e0d\u53ef\u53d8\u57fa\u7840\u8bbe\u65bdimmutable infrastructure\u3002\u56e0\u4e3a\u4e4b\u524d\u7684\u57fa\u7840\u8bbe\u65bd\u662f\u7248\u672c\u5316\u7684\u3001\u6807\u7b7e\u5316\u7684\uff0c\u6240\u4ee5\u5b89\u88c5\u8865\u4e01\u5c31\u53ea\u662f\u66f4\u65b0\u8be5\u811a\u672c\u5e76\u5c06\u5176\u63a8\u9001\u5230\u53d1\u5e03\u6d41\u7a0b\u800c\u5df2\u3002<\/p>\n \u73b0\u5728\u4f60\u77e5\u9053\u4e3a\u4ec0\u4e48\u8981\u8bf4\u57fa\u7840\u8bbe\u65bd\u5728 CI \u6d41\u7a0b\u4e2d\u7279\u522b\u91cd\u8981\u4e86\u5417\uff1f<\/p>\n via: https:\/\/opensource.com\/article\/17\/11\/continuous-infrastructure-other-ci<\/p>\n \u4f5c\u8005\uff1aGirish Managoli \u9009\u9898\uff1alujun9972 \u8bd1\u8005\uff1aJamskr \u6821\u5bf9\uff1awxy<\/p>\n \u672c\u6587\u7531 LCTT \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd \u8363\u8a89\u63a8\u51fa<\/p>\n","protected":false},"excerpt":{"rendered":" \u6301\u7eed\u4ea4\u4ed8\uff08CD\uff09\u548c\u6301\u7eed\u96c6\u6210\uff08CI\uff09\u662f DevOps \u7684\u4e24\u4e2a\u4f17\u6240\u5468\u77e5\u7684\u65b9\u9762\u3002\u4f46\u5728 CI \u5927\u8086\u6d41\u884c\u7684\u4eca\u5929\u5374\u5ffd\u7565\u4e86\u53e6 […]<\/p>\n","protected":false},"author":63,"featured_media":129994,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-129990","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/129990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=129990"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/129990\/revisions"}],"predecessor-version":[{"id":130006,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/129990\/revisions\/130006"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/129994"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=129990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=129990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=129990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}} |