{"id":164500,"date":"2019-12-09T09:00:53","date_gmt":"2019-12-09T01:00:53","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=164500"},"modified":"2019-12-09T10:33:18","modified_gmt":"2019-12-09T02:33:18","slug":"gitbook-wiki","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/gitbook-wiki.html","title":{"rendered":"\u7b80\u5355\u7c97\u66b4\u7684\u4f7f\u7528gitbook\u642d\u5efawiki\u7cfb\u7edf"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nGitBook \u662f\u4e00\u4e2a\u57fa\u4e8e Node.js \u7684\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4f7f\u7528 Github\/Git \u548c Markdown \u6765\u5236\u4f5c\u7cbe\u7f8e\u7684\u7535\u5b50\u4e66\uff0cGitBook \u5e76\u975e\u5173\u4e8e Git \u7684\u6559\u7a0b\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u8fd9\u91cc\u4f7f\u7528\u4e00\u4e2a\u7b80\u5355\u7c97\u66b4\u7684wiki\u7cfb\u7edf\uff0c\u4f7f\u7528\u573a\u666f\u4e3a\u516c\u53f8\u8fd0\u7ef4\u5185\u90e8\u4e13\u7528wiki\u7cfb\u7edf\uff0c\u4ec5\u4ec5\u4e00\u4e2a\u5c55\u793a\u9875\u9762\u3002\u8fd9\u91cc\u7b80\u5355\u8bb0\u5f55\u4e0b\uff0c\u4ee5\u4fbf\u540c\u884c\u4f7f\u7528\u3002<\/p>\n

\u672c\u5730\u7f16\u8f91md\u6587\u6863\u540e\uff0c\u901a\u8fc7git push\u5230gitlab\uff0cgitlab\u89e6\u53d1webhooks\u540e\uff0c\u7531jenkins\u81ea\u52a8\u62c9\u53d6\u540ersync\u63a8\u9001\u5230\u7ebf\u4e0aweb\u673a\u5668\uff0c\u8fdc\u7a0b\u8c03\u7528sh\u811a\u672c\u8fdb\u884c\u4e00\u6b21init build\u5373\u53ef\u3002<\/p>\n

web\u90e8\u7f72gitbook<\/strong><\/span><\/div>\n

\u5b89\u88c5nodejs\uff0c\u8fd9\u91cc\u5230\u5b98\u7f51https:\/\/nodejs.org\/en\/download\/\u76f4\u63a5\u4e0b\u8f7dnodejs\u4e8c\u8fdb\u5236\u5b89\u88c5\u5305\u89e3\u538b\u5e76\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u5373\u53ef\u3002<\/p>\n

\r\nmv node-v10.16.0-linux-x64  \/bin\/\r\nmv \/bin\/node-v10.16.0-linux-x64  \/bin\/node\r\nvim  \/etc\/profile\r\nexport  PATH=\/usr\/bin\/node\/bin:$PATH\r\nsource  \/etc\/profile\r\n<\/pre>\n
\u5b89\u88c5gitbook<\/strong><\/span><\/div>\n
\r\nnpm install gitbook-cli -g\r\n<\/pre>\n
jenkins<\/strong><\/span><\/div>\n
\r\nrsync -avz  $WORKSPACE\/ 10.1.14.17:\/data\/wwwroot\/wiki  --exclude=\".git\"  --exclude=\"metadata\" --exclude=\"mainlib.db\"\r\nssh  -Tq root@10.1.14.17<\r\n<\/pre>\n
\u914d\u7f6enginx<\/strong><\/span><\/div>\n

nginx\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n

\r\nserver {\r\n        listen       80;\r\n        server_name  wiki.21yunwei.com;\r\n        access_log \/logs\/nginx\/wiki\/wiki_access.log main;\r\n        error_log  \/logs\/nginx\/wiki\/wiki_error.log;\r\n        root \/data\/wwwroot\/wiki\/;\r\n        location \/ {\r\n                proxy_pass http:\/\/gitbook;\r\n            }\r\n        location = \/nginx-status  {\r\n            stub_status   on;\r\n            access_log   off;\r\n}\r\n<\/pre>\n

\u672c\u5730\u7f16\u8f91md\u6587\u4ef6\u540e\u76f4\u63a5push\u5230gitlab\uff0c\u89e6\u53d1webhook\u540e\u7531jenkins\u6267\u884c\u540e\u53d8\u7684\u63a8\u9001\u4ee5\u53ca\u8fdc\u7a0b\u6267\u884csh\u8fdb\u884cinit\uff0c\u8fd9\u6837web\u5c31\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u9759\u6001\u9875\u9762\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u8fd9\u91cc\u4f7f\u7528\u4e00\u4e2a\u7b80\u5355\u7c97\u66b4\u7684wiki\u7cfb\u7edf\uff0c\u4f7f\u7528\u573a\u666f\u4e3a\u516c\u53f8\u8fd0\u7ef4\u5185\u90e8\u4e13\u7528wiki\u7cfb\u7edf\uff0c\u4ec5\u4ec5\u4e00\u4e2a\u5c55\u793a\u9875\u9762\u3002\u8fd9\u91cc\u7b80\u5355\u8bb0\u5f55\u4e0b\uff0c […]<\/p>\n","protected":false},"author":668,"featured_media":164730,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-164500","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\/164500","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\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=164500"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/164500\/revisions"}],"predecessor-version":[{"id":164946,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/164500\/revisions\/164946"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/164730"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=164500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=164500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=164500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}