forked from erguotou520/HexoBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.json
1 lines (1 loc) · 96.7 KB
/
db.json
1
{"meta":{"version":1,"warehouse":"2.2.0"},"models":{"Asset":[{"_id":"source/images/avatar.jpg","path":"images/avatar.jpg","modified":0,"renderable":0},{"_id":"source/images/favicon.png","path":"images/favicon.png","modified":0,"renderable":0},{"_id":"source/images/avatar.png","path":"images/avatar.png","modified":0,"renderable":0},{"_id":"themes/icarus/source/images/avatar.png","path":"images/avatar.png","modified":0,"renderable":1},{"_id":"themes/icarus/source/images/favicon.png","path":"images/favicon.png","modified":0,"renderable":1},{"_id":"themes/icarus/source/images/logo.svg","path":"images/logo.svg","modified":0,"renderable":1},{"_id":"themes/icarus/source/images/favicon.svg","path":"images/favicon.svg","modified":0,"renderable":1},{"_id":"themes/icarus/source/images/thumbnail.svg","path":"images/thumbnail.svg","modified":0,"renderable":1},{"_id":"themes/icarus/source/css/back-to-top.css","path":"css/back-to-top.css","modified":0,"renderable":1},{"_id":"themes/icarus/source/css/insight.css","path":"css/insight.css","modified":0,"renderable":1},{"_id":"themes/icarus/source/css/progressbar.css","path":"css/progressbar.css","modified":0,"renderable":1},{"_id":"themes/icarus/source/css/search.css","path":"css/search.css","modified":0,"renderable":1},{"_id":"themes/icarus/source/css/style.styl","path":"css/style.styl","modified":0,"renderable":1},{"_id":"themes/icarus/source/js/animation.js","path":"js/animation.js","modified":0,"renderable":1},{"_id":"themes/icarus/source/js/back-to-top.js","path":"js/back-to-top.js","modified":0,"renderable":1},{"_id":"themes/icarus/source/js/gallery.js","path":"js/gallery.js","modified":0,"renderable":1},{"_id":"themes/icarus/source/js/insight.js","path":"js/insight.js","modified":0,"renderable":1},{"_id":"themes/icarus/source/js/clipboard.js","path":"js/clipboard.js","modified":0,"renderable":1},{"_id":"themes/icarus/source/js/main.js","path":"js/main.js","modified":0,"renderable":1},{"_id":"source/images/ci/flow.png","path":"images/ci/flow.png","modified":0,"renderable":0}],"Cache":[{"_id":"themes/icarus/.gitignore","hash":"35572c0f161a751b9f30ae3a9935ac045dba5220","modified":1585112398012},{"_id":"themes/icarus/README.md","hash":"4409383fbd7422800049d6597e9b26aa8db66b66","modified":1585112398012},{"_id":"themes/icarus/LICENSE","hash":"41f72cd544612bc4589c924c776422b800a4eff7","modified":1585112398012},{"_id":"themes/icarus/_config.yml","hash":"d7bbdb8a9cf585630124a34f2fed269a72bc6f56","modified":1585114921940},{"_id":"themes/icarus/package.json","hash":"4167e65682af257bdf8531a05730e6c42339996d","modified":1585112398036},{"_id":"source/_drafts/interview.md","hash":"bebfa94a8636df3d2626b7d2e3529e821ad1f709","modified":1585112397914},{"_id":"source/_posts/ci.md","hash":"e7f041540058b397b4b7d3b34ecf7a17ad4dbbd4","modified":1585112397915},{"_id":"source/_posts/giteaForBt.md","hash":"c7a654dfa088d35f8e571cdbb56d2e42ce3b3048","modified":1585116547599},{"_id":"source/about/index.md","hash":"2847759c65295fdc47685cc32e10ae30b2f022ae","modified":1585112397923},{"_id":"source/categories/index.md","hash":"55bee2cb88da438a2e8b1f29b1d7e954c07a9e60","modified":1585112397923},{"_id":"source/images/avatar.jpg","hash":"9945dcd383f0e0f88c37218cc21efc176decbb43","modified":1585112397924},{"_id":"source/images/favicon.png","hash":"0490dfbcbfce6f149de2079109f4cde830aa5936","modified":1585112397932},{"_id":"source/tags/index.md","hash":"e999413d6392c34156b5c6e9273f9069f9e6d92d","modified":1585112398011},{"_id":"themes/icarus/languages/es.yml","hash":"8827823e5b2ce967566854c9bfebc7c69098b4ac","modified":1585112398024},{"_id":"themes/icarus/languages/en.yml","hash":"b69c91878f30937f50438ff64dffd3f6bf91bcf5","modified":1585112398024},{"_id":"themes/icarus/languages/fr.yml","hash":"0017f93a5d491a9c0e55911cdc35316762c5a94e","modified":1585112398024},{"_id":"themes/icarus/languages/id.yml","hash":"92d2d19a62a17b6e99f82a014309bbf6c13c9ae8","modified":1585112398025},{"_id":"themes/icarus/languages/ja.yml","hash":"6eed7771de2353d71b720c6e605cceb3f230b12e","modified":1585112398025},{"_id":"themes/icarus/languages/pt-BR.yml","hash":"bcf5bc81ca855d26bbc3b3bfabc7d84429e74b85","modified":1585112398026},{"_id":"themes/icarus/languages/ko.yml","hash":"06d2bb8b66f68f780218e0ba7edffe1e57fac268","modified":1585112398026},{"_id":"themes/icarus/languages/ru.yml","hash":"ba8b4f7d77eb1d1e28aa1f9107bd0bbbdc4cba99","modified":1585112398026},{"_id":"themes/icarus/languages/tr.yml","hash":"eff1c0b3d5c4b328f6dd74a195ff378c898f4d29","modified":1585112398026},{"_id":"themes/icarus/languages/zh-CN.yml","hash":"804f6a1edee49bb6a5ecb8e9d14d3e93eaca37c0","modified":1585112398026},{"_id":"themes/icarus/languages/zh-TW.yml","hash":"79fab0bff625634fb6bb6cadf9c547bd36226dcf","modified":1585112398027},{"_id":"themes/icarus/layout/archive.ejs","hash":"64a81f4c6ca9517169413408d076371e8e09c63a","modified":1585112398027},{"_id":"themes/icarus/layout/categories.ejs","hash":"29d304f2b95a04fbc5e7529f9bdce9648e3545ef","modified":1585112398027},{"_id":"themes/icarus/layout/category.ejs","hash":"bda344da0e6c03899f53abc20ae2a2efab5ab243","modified":1585112398027},{"_id":"themes/icarus/layout/index.ejs","hash":"71120f41d019bf2866a5556747e5e671c8147f85","modified":1585112398031},{"_id":"themes/icarus/layout/page.ejs","hash":"50170783bac99946ae8af483920568de9b2d9801","modified":1585112398031},{"_id":"themes/icarus/layout/tag.ejs","hash":"1feac7aa842882757a479b8ad427f6a72fce70c4","modified":1585112398034},{"_id":"themes/icarus/layout/post.ejs","hash":"50170783bac99946ae8af483920568de9b2d9801","modified":1585112398033},{"_id":"themes/icarus/layout/tags.ejs","hash":"0c527c6b72386f11c18e8aa5249be8c601e69906","modified":1585112398034},{"_id":"themes/icarus/layout/layout.ejs","hash":"da63c914247eba116ea5263bfc27a69e96f859b6","modified":1585112398031},{"_id":"themes/icarus/scripts/index.js","hash":"9203e2ba1f821d945edf20fc277f3c58d22bfd00","modified":1585112398036},{"_id":"source/images/avatar.png","hash":"67dd91cd2fa1164090b346a6d4144de8ca02f0d1","modified":1585112397925},{"_id":"themes/icarus/includes/generators/categories.js","hash":"7cb370ac53a05d6b1b9203579716c0ca83d35c36","modified":1585112398016},{"_id":"themes/icarus/includes/generators/insight.js","hash":"c4b981443927b87cc14a3a583029e13f819d6d71","modified":1585112398017},{"_id":"themes/icarus/includes/filters/highlight.js","hash":"19a4dcd2dee7388544b57e473cfb0fc9eea9623e","modified":1585112398016},{"_id":"themes/icarus/includes/generators/category.js","hash":"313e170e55d74526c4e1be7181ef7a21439147c9","modified":1585112398016},{"_id":"themes/icarus/includes/helpers/layout.js","hash":"afdf5e9704cfc087526b4a0403fe7eb04f22190e","modified":1585112398017},{"_id":"themes/icarus/includes/helpers/cdn.js","hash":"7d34ea6400cb3611c374c135304abcb65ef291b7","modified":1585112398017},{"_id":"themes/icarus/includes/helpers/config.js","hash":"173e02987e7a7d5df1e686f6ee4edd8cf494bdd3","modified":1585112398017},{"_id":"themes/icarus/includes/helpers/override.js","hash":"726cf99612fd060753d9da08db2776aec1802e20","modified":1585112398018},{"_id":"themes/icarus/includes/helpers/page.js","hash":"25aeed6449ca381661cec528fe96bbb993026ca9","modified":1585112398018},{"_id":"themes/icarus/includes/generators/tags.js","hash":"8195322c208706427a1cf56361669dca4d86f6f1","modified":1585112398017},{"_id":"themes/icarus/includes/helpers/site.js","hash":"f154ddb0dac79fd28ced2b518f8052b42555d0c9","modified":1585112398018},{"_id":"themes/icarus/includes/tasks/check_deps.js","hash":"8f40e4d49500ceebbc220d7e8f57b83d527329d6","modified":1585112398023},{"_id":"themes/icarus/includes/tasks/check_config.js","hash":"ce7626d643737c90dee6b75435ccdec26b89dacf","modified":1585112398022},{"_id":"themes/icarus/includes/tasks/welcome.js","hash":"00d1ef8c9609552b82e9a5140b838a9057c59508","modified":1585112398023},{"_id":"themes/icarus/includes/specs/donate.spec.js","hash":"639b405c9e5dac04c2dc168c2754e50a5c13d197","modified":1585112398018},{"_id":"themes/icarus/includes/specs/article.spec.js","hash":"a805c1a6f03ccb07d73512aef40d38541ddbb0eb","modified":1585112398018},{"_id":"themes/icarus/includes/specs/config.spec.js","hash":"7a9bac384a73cf9f39173fdb2dfc2813784d8891","modified":1585112398018},{"_id":"themes/icarus/includes/specs/footer.spec.js","hash":"49fabe9c03f3124f0253fa1ee3e69328373ad117","modified":1585112398019},{"_id":"themes/icarus/includes/specs/icon_link.spec.js","hash":"f2a83ac5ccb74fc6f3dfbd25430e142297d8491c","modified":1585112398019},{"_id":"themes/icarus/includes/specs/comment.spec.js","hash":"02af67eb87482028b223299b20a129756b1c122b","modified":1585112398018},{"_id":"themes/icarus/includes/specs/meta.spec.js","hash":"70abe77d3664176ec977316522014ce7e0aa439d","modified":1585112398019},{"_id":"themes/icarus/includes/specs/plugins.spec.js","hash":"3db2046311dd0392aed0ba2d81b51a081131f1de","modified":1585112398019},{"_id":"themes/icarus/includes/specs/navbar.spec.js","hash":"67ebd05fb378439a094a7906f4ea04fbedd8c1b5","modified":1585112398019},{"_id":"themes/icarus/includes/specs/providers.spec.js","hash":"e29473155a35f391fbc53349bdc256cb7600855e","modified":1585112398019},{"_id":"themes/icarus/includes/specs/share.spec.js","hash":"6c04cccec13a656189ab2d917d69d059027d0343","modified":1585112398019},{"_id":"themes/icarus/includes/specs/widgets.spec.js","hash":"eeeaae3ed079033788b19e172cd1f83c5ca8bc4f","modified":1585112398020},{"_id":"themes/icarus/includes/specs/sidebar.spec.js","hash":"bd500be763486918894e731ce14bc9c4047fb76d","modified":1585112398020},{"_id":"themes/icarus/includes/specs/search.spec.js","hash":"d981ad203a2002c35d710d33e304f9e99f31cab0","modified":1585112398019},{"_id":"themes/icarus/includes/common/ConfigGenerator.js","hash":"451397efc7808787419fa3eb6b043c0bd8bbdf30","modified":1585112398015},{"_id":"themes/icarus/includes/common/utils.js","hash":"c0aeaeb57a42bcc71a92da2249762f91abd83ffe","modified":1585112398016},{"_id":"themes/icarus/includes/common/ConfigValidator.js","hash":"cd3cd12bc042b401825fd7bfd9a6434c8b14e092","modified":1585112398016},{"_id":"themes/icarus/layout/common/footer.ejs","hash":"9e57d97a52ad358b5f38cf87a3fda356d2094b6d","modified":1585112398029},{"_id":"themes/icarus/layout/common/head.ejs","hash":"bd72ffd5942bb2fd18319d551bbaa59647e33f3c","modified":1585112398029},{"_id":"themes/icarus/layout/common/article.ejs","hash":"8af2176cc3fe6a5fc9fcf727c4e3fbc5afec9269","modified":1585112398029},{"_id":"themes/icarus/layout/common/scripts.ejs","hash":"5414d6bfbf88efa7e72ccf7e44a79d0378ddeb77","modified":1585112398030},{"_id":"themes/icarus/layout/common/navbar.ejs","hash":"5082ea45df0f79f955143177287d92bcf3832fcf","modified":1585112398029},{"_id":"themes/icarus/layout/common/widget.ejs","hash":"5417af9f208d2fb5aaeb96031caa261e9683557c","modified":1585112398030},{"_id":"themes/icarus/layout/common/paginator.ejs","hash":"7837d80b27f166161b3deeffb571680025c7d723","modified":1585112398029},{"_id":"themes/icarus/layout/donate/paypal.ejs","hash":"3975dee39f9378975b9c10f37d118ad7cb6f5bf6","modified":1585112398030},{"_id":"themes/icarus/layout/donate/alipay.ejs","hash":"3290058879973e403a05472a0fe2ac0219d5b961","modified":1585112398030},{"_id":"themes/icarus/layout/donate/wechat.ejs","hash":"051b873e1fc28c1d7c2d6443991b6a2f43813e6b","modified":1585112398030},{"_id":"themes/icarus/layout/donate/patreon.ejs","hash":"8e52a9c28ffaf4b0b786a20977b848c5f60f2274","modified":1585112398030},{"_id":"themes/icarus/layout/comment/disqus.ejs","hash":"b5fff46e453d58baa20028a47fd85923494bb85c","modified":1585112398027},{"_id":"themes/icarus/layout/comment/facebook.ejs","hash":"b38ea86a1cae48f671501af74d7f109f63fb3d72","modified":1585112398027},{"_id":"themes/icarus/layout/comment/gitalk.ejs","hash":"ef01396e64ab4f6e62155f0b357bcd903138d611","modified":1585112398028},{"_id":"themes/icarus/layout/comment/changyan.ejs","hash":"9ccc7ec354b968e60bdcfcd1dba451d38de61f12","modified":1585112398027},{"_id":"themes/icarus/layout/comment/gitment.ejs","hash":"033fb890dc1de71f7d3b97061d0d75f4564bd09a","modified":1585112398028},{"_id":"themes/icarus/layout/comment/livere.ejs","hash":"12ff9a345f6bba2f732f592e39508c2afde89b00","modified":1585112398028},{"_id":"themes/icarus/layout/comment/valine.ejs","hash":"a29cf2e69f66a37ddcec8343c60af1e676dcb77d","modified":1585112398028},{"_id":"themes/icarus/layout/comment/isso.ejs","hash":"cc6a43bd24be764086f88ad7c5c97ff04df87e0b","modified":1585112398028},{"_id":"themes/icarus/layout/plugin/animejs.ejs","hash":"198062ef863c96aa4d6a8225d575afcb60dfb1d1","modified":1585112398031},{"_id":"themes/icarus/layout/plugin/baidu-analytics.ejs","hash":"eb66e313ad43ec4424b2d75bae94e5c8a7568428","modified":1585112398031},{"_id":"themes/icarus/layout/plugin/busuanzi.ejs","hash":"205dedf8f97e328bb3182dc8daebd2e2b2204aca","modified":1585112398032},{"_id":"themes/icarus/layout/plugin/gallery.ejs","hash":"ad68fafd923747d6b7c1b5873d00989d1639678c","modified":1585112398032},{"_id":"themes/icarus/layout/plugin/back-to-top.ejs","hash":"79d1118a3d3ebc521ffce452b986b504f0e7d6b7","modified":1585112398031},{"_id":"themes/icarus/layout/plugin/google-analytics.ejs","hash":"282cecb28ac458b71b56cf429c72ffac0f820199","modified":1585112398032},{"_id":"themes/icarus/layout/plugin/clipboard.ejs","hash":"8662ed9c211f3993b93eedcf5e41c2a1ddbede57","modified":1585112398032},{"_id":"themes/icarus/layout/plugin/mathjax.ejs","hash":"667aabb6b9cb4d707b37975af794d4a3c66b5264","modified":1585112398033},{"_id":"themes/icarus/layout/plugin/hotjar.ejs","hash":"2b97737d802984750a7b4461fcf68818a57a2439","modified":1585112398032},{"_id":"themes/icarus/layout/plugin/outdated-browser.ejs","hash":"fe051093893c64c8575bcc67dc1c146d409e8e80","modified":1585112398033},{"_id":"themes/icarus/layout/search/google-cse.ejs","hash":"4b881a99325a6a0cebf97ac53e09d8fc67f87d29","modified":1585112398033},{"_id":"themes/icarus/layout/search/baidu.ejs","hash":"850aa91778100d693a52b10eaa8586c8e3215ee6","modified":1585112398033},{"_id":"themes/icarus/layout/search/insight.ejs","hash":"9a27db2a007582ceee7ca4b1eebddbd456893568","modified":1585112398033},{"_id":"themes/icarus/layout/plugin/progressbar.ejs","hash":"e594ed6705bccbef27f49d84b6153f6443efbecd","modified":1585112398033},{"_id":"themes/icarus/layout/share/addthis.ejs","hash":"f1c5f337333009d5f00dfbac4864a16ef8f9cb8d","modified":1585112398034},{"_id":"themes/icarus/layout/share/bdshare.ejs","hash":"f14c8084b7ee16a091f0bd2ae9039e3bfff7e7b7","modified":1585112398034},{"_id":"themes/icarus/layout/share/sharejs.ejs","hash":"65d08316cc479910ea4f526cd1c299d0104daf7f","modified":1585112398034},{"_id":"themes/icarus/layout/share/sharethis.ejs","hash":"4f2c40f790f3be0a4e79db04f02ea41ba2f4d4c0","modified":1585112398034},{"_id":"themes/icarus/layout/share/addtoany.ejs","hash":"04cb247d8c83ca7c5b52f3b11bb3ac155b1bc3ab","modified":1585112398034},{"_id":"themes/icarus/layout/widget/archive.ejs","hash":"eb738a2ac2935ce7a542964d90088613b281dd15","modified":1585112398035},{"_id":"themes/icarus/layout/widget/category.ejs","hash":"c2a9f2211a21a168c54b0563cdfd58bd25fa39fe","modified":1585112398035},{"_id":"themes/icarus/layout/widget/links.ejs","hash":"2b707fd65c94b00d8b4c6755fbc6c19709f3d49a","modified":1585112398035},{"_id":"themes/icarus/layout/widget/profile.ejs","hash":"04ef01227b140b74c0396196dd7a1996f3cccf95","modified":1585112398035},{"_id":"themes/icarus/layout/widget/recent_posts.ejs","hash":"2166f3190e47bf4746775b5d16654564a88c2041","modified":1585112398035},{"_id":"themes/icarus/layout/widget/tag.ejs","hash":"8c5b8020ca776cc3ebbc7b723915f3173efc28d4","modified":1585112398035},{"_id":"themes/icarus/layout/widget/tagcloud.ejs","hash":"d32e7c56e8e2074da16d9141f9a597841d28d07d","modified":1585112398035},{"_id":"themes/icarus/source/images/avatar.png","hash":"0d8236dcca871735500e9d06bbdbe0853ed6775b","modified":1585112398037},{"_id":"themes/icarus/source/images/favicon.png","hash":"7091b0c8feba52554f9db95079278fd145bee9db","modified":1585112398038},{"_id":"themes/icarus/layout/widget/toc.ejs","hash":"bdc6f22602cdabe7c740f1818e0681ff8508fb64","modified":1585112398036},{"_id":"themes/icarus/source/images/logo.svg","hash":"fad38ed23dc05d17df635cbfe6341cad834288d8","modified":1585112398038},{"_id":"themes/icarus/source/images/favicon.svg","hash":"16fd847265845063a16596761cddb32926073dd2","modified":1585112398038},{"_id":"themes/icarus/source/images/thumbnail.svg","hash":"b9c58ff09ed415e6cf08b42b35faa2bc000d5059","modified":1585112398039},{"_id":"themes/icarus/source/css/back-to-top.css","hash":"5805bee2445e997d64dfe526b08b5fe0bce357eb","modified":1585112398036},{"_id":"themes/icarus/source/css/insight.css","hash":"22943a610d5cfffedfb823c692f4db2b1f37a4c9","modified":1585112398036},{"_id":"themes/icarus/source/css/progressbar.css","hash":"bbc737b7a8feb19901e792c447a846273779d5c3","modified":1585112398036},{"_id":"themes/icarus/source/css/search.css","hash":"c1cb306e075386517ac15bf4ef37c647d37ec6b5","modified":1585112398036},{"_id":"themes/icarus/source/css/style.styl","hash":"ad08f90895a66e178fdc0dc4635d35780427bfe8","modified":1585112398037},{"_id":"themes/icarus/source/js/animation.js","hash":"d744581909d2d092a584be07c39f9d3f0d009ec7","modified":1585112398039},{"_id":"themes/icarus/source/js/back-to-top.js","hash":"b1dcf30577cefe833dc6151757c0a05ea5b5a643","modified":1585112398039},{"_id":"themes/icarus/source/js/gallery.js","hash":"88b23abfc3b519413be54533ed0f39e0c68fcdd1","modified":1585112398040},{"_id":"themes/icarus/source/js/insight.js","hash":"8ba56fd5e4232a05ccef5f8b733c7ecca0814633","modified":1585112398040},{"_id":"themes/icarus/source/js/clipboard.js","hash":"6fdd602268727744b6b2c8ad79d684aab3cffda5","modified":1585112398039},{"_id":"themes/icarus/source/js/main.js","hash":"3357a1798a994afad0a849a679ca2ed6e0ce2424","modified":1585112398040},{"_id":"source/images/ci/flow.png","hash":"0f4a50c1b16417e73b87c6b3da222aeaf09d857b","modified":1585112397926},{"_id":"public/content.json","hash":"b7a10a03c89f9a9a32817ff87062774a6b7cb41d","modified":1585116571169},{"_id":"public/about/index.html","hash":"7e6dfa2c4beae9fd7157e6e4c4b7320fb8734273","modified":1585116571599},{"_id":"public/categories/index.html","hash":"9b16e24d8673afa6e328e322f0ae832d71bf5845","modified":1585116571599},{"_id":"public/tags/index.html","hash":"3dc88057b8249440c35fa7e70a27179d78418466","modified":1585116571868},{"_id":"public/ci.html","hash":"cfb362febe30ecd4cac15f144deb880acc1beb3d","modified":1585116571868},{"_id":"public/archives/index.html","hash":"645949b6d2aa1218f1ae4aafe23e15064938f65c","modified":1585116571870},{"_id":"public/archives/2017/index.html","hash":"00e54333e92bd932836daacfa261594336019346","modified":1585116571870},{"_id":"public/archives/2017/01/index.html","hash":"895e47fead9f05d96ef76e9fcd462c1479893fac","modified":1585116571871},{"_id":"public/index.html","hash":"54e112971035ef8754fa9b2cb916ad604865150e","modified":1585116571871},{"_id":"public/giteaForBt.html","hash":"0e386a1608439f4cba9191062bb9166685106655","modified":1585116571875},{"_id":"public/archives/2020/index.html","hash":"0c8debe45d62671bc7d35689787cf8f31c340b7a","modified":1585116571875},{"_id":"public/archives/2020/03/index.html","hash":"abbeb5ef84f8e597ea5c7a01817da23ca358a0a5","modified":1585116571906},{"_id":"public/tags/git/index.html","hash":"0c39f3589ab651173593f570bb198ac46c8c262a","modified":1585116571907},{"_id":"public/tags/linux/index.html","hash":"9a08334e49914ac35ab3373f8a24235af4d3d79d","modified":1585116571907},{"_id":"public/tags/gitea/index.html","hash":"501bb5867bbfd58a030a146ebeaf8adebdbba4f1","modified":1585116571907},{"_id":"public/tags/travis-ci/index.html","hash":"a5ee6aa1ad2445cfe4e6bfd9e2efcf52691429be","modified":1585116571907},{"_id":"public/tags/gitlab-ci/index.html","hash":"45cb680a6be1e3253d2e1c975714d5216f0ba188","modified":1585116571908},{"_id":"public/tags/ci/index.html","hash":"2705cf5d22e3e24484efba75c3771670b04bfdc2","modified":1585116571908},{"_id":"public/tags/服务器/index.html","hash":"37e0aae42d01b24c85988e148d0122be85bf8d5a","modified":1585116571910},{"_id":"public/images/avatar.jpg","hash":"9945dcd383f0e0f88c37218cc21efc176decbb43","modified":1585116571910},{"_id":"public/images/favicon.png","hash":"7091b0c8feba52554f9db95079278fd145bee9db","modified":1585116571910},{"_id":"public/images/avatar.png","hash":"0d8236dcca871735500e9d06bbdbe0853ed6775b","modified":1585116571910},{"_id":"public/images/logo.svg","hash":"fad38ed23dc05d17df635cbfe6341cad834288d8","modified":1585116571910},{"_id":"public/images/favicon.svg","hash":"16fd847265845063a16596761cddb32926073dd2","modified":1585116571910},{"_id":"public/images/thumbnail.svg","hash":"b9c58ff09ed415e6cf08b42b35faa2bc000d5059","modified":1585116571910},{"_id":"public/images/ci/flow.png","hash":"0f4a50c1b16417e73b87c6b3da222aeaf09d857b","modified":1585116571910},{"_id":"public/css/insight.css","hash":"22943a610d5cfffedfb823c692f4db2b1f37a4c9","modified":1585116572140},{"_id":"public/css/progressbar.css","hash":"bbc737b7a8feb19901e792c447a846273779d5c3","modified":1585116572140},{"_id":"public/css/back-to-top.css","hash":"5805bee2445e997d64dfe526b08b5fe0bce357eb","modified":1585116572141},{"_id":"public/css/search.css","hash":"c1cb306e075386517ac15bf4ef37c647d37ec6b5","modified":1585116572141},{"_id":"public/js/animation.js","hash":"d744581909d2d092a584be07c39f9d3f0d009ec7","modified":1585116572141},{"_id":"public/js/gallery.js","hash":"88b23abfc3b519413be54533ed0f39e0c68fcdd1","modified":1585116572141},{"_id":"public/js/clipboard.js","hash":"6fdd602268727744b6b2c8ad79d684aab3cffda5","modified":1585116572141},{"_id":"public/js/main.js","hash":"3357a1798a994afad0a849a679ca2ed6e0ce2424","modified":1585116572141},{"_id":"public/js/back-to-top.js","hash":"b1dcf30577cefe833dc6151757c0a05ea5b5a643","modified":1585116572141},{"_id":"public/css/style.css","hash":"27b3a29db62647744711a6424a1309cf04e48ce1","modified":1585116572144},{"_id":"public/js/insight.js","hash":"8ba56fd5e4232a05ccef5f8b733c7ecca0814633","modified":1585116572144}],"Category":[],"Data":[],"Page":[{"title":"About","layout":"page","_content":"\n","source":"about/index.md","raw":"title: \"About\"\nlayout: \"page\"\n---\n\n","date":"2020-03-25T04:59:57.923Z","updated":"2020-03-25T04:59:57.923Z","path":"about/index.html","comments":1,"_id":"ck86xh9qi00013nh5n4u8n33o","content":"","site":{"data":{}},"excerpt":"","more":""},{"title":"Categories","layout":"categories","_content":"","source":"categories/index.md","raw":"title: \"Categories\"\nlayout: \"categories\"\n---\n","date":"2020-03-25T04:59:57.923Z","updated":"2020-03-25T04:59:57.923Z","path":"categories/index.html","comments":1,"_id":"ck86xh9ql00033nh5fgontm57","content":"","site":{"data":{}},"excerpt":"","more":""},{"title":"Tags","layout":"tags","_content":"","source":"tags/index.md","raw":"title: \"Tags\"\nlayout: \"tags\"\n---\n","date":"2020-03-25T04:59:58.011Z","updated":"2020-03-25T04:59:58.011Z","path":"tags/index.html","comments":1,"_id":"ck86xh9qy000j3nh5pn66f3an","content":"","site":{"data":{}},"excerpt":"","more":""}],"Post":[{"layout":"false","_content":"1、如何使用自动化构建工具的都做了什么内容,代码校验与单元测试,jshint配置了哪些。\n2、http相关知识get post有什么区别,https 如何加密解密、fillder如何抓取 https的包的。\n3、vue 与 angular 的区别,vue 如何做数据渲染处理的,如何实现声明周期。\n4、js基础 闭包 作用域 原型链 数组都有哪些方法。\n5、有个对象 object 为下面样式,object 的节点可能无线延伸\n {\n\ta:b,\n\tb:{\n\t\ta:a,\n\t\tb:b\n\t},\n\tc:c\n }\n 将该对象输出成下面的字符串:\n \"\n {\n\ta:a,\n\tb.a:a,\n b.b:b,\n c:c\n }\n \"\n6、babel 在使用是有什么问题,都有哪些坑。\n7、使用sftp 自动上传服务器,实现自动发布,如果网络断了怎么办,如何来处理。\n8、说一下你是怎么设计负责的订单模块的。\n\n1、在浏览器中打开一个网站都会发生什么事情,说的越详细越好,两台计算机之间是如何通信的。\n2、http代码代表什么意思,302 301 304 等等。\n3、js跨域都有哪些方案并说出优缺点。\n4、vue 的component组建是如何使用的与父级之间怎么传递参数。\n5、grunt gulp fis webpack 有什么区别,分别适用场景。\n6、cmd与amd规范中的 export 与 es6的 export 有什么区别。\n7、一个数组求第N大。\n8、promise 写出一个红绿灯的题。\n9、订单模块如何来设计说一下设计思路。\n10、cookie与loaclstorage、sessionstorage有什么区别。\n11、js引擎编译工作方式。\n","source":"_drafts/interview.md","raw":"---\nlayout: false\n---\n1、如何使用自动化构建工具的都做了什么内容,代码校验与单元测试,jshint配置了哪些。\n2、http相关知识get post有什么区别,https 如何加密解密、fillder如何抓取 https的包的。\n3、vue 与 angular 的区别,vue 如何做数据渲染处理的,如何实现声明周期。\n4、js基础 闭包 作用域 原型链 数组都有哪些方法。\n5、有个对象 object 为下面样式,object 的节点可能无线延伸\n {\n\ta:b,\n\tb:{\n\t\ta:a,\n\t\tb:b\n\t},\n\tc:c\n }\n 将该对象输出成下面的字符串:\n \"\n {\n\ta:a,\n\tb.a:a,\n b.b:b,\n c:c\n }\n \"\n6、babel 在使用是有什么问题,都有哪些坑。\n7、使用sftp 自动上传服务器,实现自动发布,如果网络断了怎么办,如何来处理。\n8、说一下你是怎么设计负责的订单模块的。\n\n1、在浏览器中打开一个网站都会发生什么事情,说的越详细越好,两台计算机之间是如何通信的。\n2、http代码代表什么意思,302 301 304 等等。\n3、js跨域都有哪些方案并说出优缺点。\n4、vue 的component组建是如何使用的与父级之间怎么传递参数。\n5、grunt gulp fis webpack 有什么区别,分别适用场景。\n6、cmd与amd规范中的 export 与 es6的 export 有什么区别。\n7、一个数组求第N大。\n8、promise 写出一个红绿灯的题。\n9、订单模块如何来设计说一下设计思路。\n10、cookie与loaclstorage、sessionstorage有什么区别。\n11、js引擎编译工作方式。\n","slug":"interview","published":0,"date":"1970-01-01T00:00:00.000Z","updated":"2020-03-25T04:59:57.914Z","title":"","comments":1,"photos":[],"link":"","_id":"ck86xh9qe00003nh59mup0bu9","content":"<p>1、如何使用自动化构建工具的都做了什么内容,代码校验与单元测试,jshint配置了哪些。<br>\n2、http相关知识get post有什么区别,https 如何加密解密、fillder如何抓取 https的包的。<br>\n3、vue 与 angular 的区别,vue 如何做数据渲染处理的,如何实现声明周期。<br>\n4、js基础 闭包 作用域 原型链 数组都有哪些方法。<br>\n5、有个对象 object 为下面样式,object 的节点可能无线延伸<br>\n{<br>\na:b,<br>\nb:{<br>\na:a,<br>\nb:b<br>\n},<br>\nc:c<br>\n}<br>\n将该对象输出成下面的字符串:<br>\n"<br>\n{<br>\na:a,<br>\nb.a:a,<br>\nb.b:b,<br>\nc:c<br>\n}<br>\n"<br>\n6、babel 在使用是有什么问题,都有哪些坑。<br>\n7、使用sftp 自动上传服务器,实现自动发布,如果网络断了怎么办,如何来处理。<br>\n8、说一下你是怎么设计负责的订单模块的。</p>\n<p>1、在浏览器中打开一个网站都会发生什么事情,说的越详细越好,两台计算机之间是如何通信的。<br>\n2、http代码代表什么意思,302 301 304 等等。<br>\n3、js跨域都有哪些方案并说出优缺点。<br>\n4、vue 的component组建是如何使用的与父级之间怎么传递参数。<br>\n5、grunt gulp fis webpack 有什么区别,分别适用场景。<br>\n6、cmd与amd规范中的 export 与 es6的 export 有什么区别。<br>\n7、一个数组求第N大。<br>\n8、promise 写出一个红绿灯的题。<br>\n9、订单模块如何来设计说一下设计思路。<br>\n10、cookie与loaclstorage、sessionstorage有什么区别。<br>\n11、js引擎编译工作方式。</p>\n","site":{"data":{}},"excerpt":"","more":"<p>1、如何使用自动化构建工具的都做了什么内容,代码校验与单元测试,jshint配置了哪些。<br>\n2、http相关知识get post有什么区别,https 如何加密解密、fillder如何抓取 https的包的。<br>\n3、vue 与 angular 的区别,vue 如何做数据渲染处理的,如何实现声明周期。<br>\n4、js基础 闭包 作用域 原型链 数组都有哪些方法。<br>\n5、有个对象 object 为下面样式,object 的节点可能无线延伸<br>\n{<br>\na:b,<br>\nb:{<br>\na:a,<br>\nb:b<br>\n},<br>\nc:c<br>\n}<br>\n将该对象输出成下面的字符串:<br>\n"<br>\n{<br>\na:a,<br>\nb.a:a,<br>\nb.b:b,<br>\nc:c<br>\n}<br>\n"<br>\n6、babel 在使用是有什么问题,都有哪些坑。<br>\n7、使用sftp 自动上传服务器,实现自动发布,如果网络断了怎么办,如何来处理。<br>\n8、说一下你是怎么设计负责的订单模块的。</p>\n<p>1、在浏览器中打开一个网站都会发生什么事情,说的越详细越好,两台计算机之间是如何通信的。<br>\n2、http代码代表什么意思,302 301 304 等等。<br>\n3、js跨域都有哪些方案并说出优缺点。<br>\n4、vue 的component组建是如何使用的与父级之间怎么传递参数。<br>\n5、grunt gulp fis webpack 有什么区别,分别适用场景。<br>\n6、cmd与amd规范中的 export 与 es6的 export 有什么区别。<br>\n7、一个数组求第N大。<br>\n8、promise 写出一个红绿灯的题。<br>\n9、订单模块如何来设计说一下设计思路。<br>\n10、cookie与loaclstorage、sessionstorage有什么区别。<br>\n11、js引擎编译工作方式。</p>\n"},{"layout":"post","title":"giteaForBt","date":"2020-03-25T06:04:46.000Z","thumbnail":"/images/ci/flow.png","_content":"\n## 什么是gitea","source":"_posts/giteaForBt.md","raw":"---\nlayout: post\ntitle: giteaForBt\ndate: 2020-03-25 14:04:46\nthumbnail: /images/ci/flow.png\ntags:\n- git\n- gitea\n- linux\n- 服务器\n---\n\n## 什么是gitea","slug":"giteaForBt","published":1,"updated":"2020-03-25T06:09:07.599Z","comments":1,"photos":[],"link":"","_id":"ck86xh9qj00023nh53ukrzl1j","content":"<h2 id=\"什么是gitea\"><a class=\"header-anchor\" href=\"#什么是gitea\">¶</a>什么是gitea</h2>\n","site":{"data":{}},"excerpt":"","more":"<h2 id=\"什么是gitea\"><a class=\"header-anchor\" href=\"#什么是gitea\">¶</a>什么是gitea</h2>\n"},{"title":"CI简介和实际应用","s":"ci-intro","date":"2017-01-16T15:06:00.000Z","thumbnail":"/images/ci/flow.png","_content":"\n## 什么是CI\n引用知乎上的一个回答\n> 作者:赵劼\n> 链接:https://www.zhihu.com/question/23444990/answer/26995938\n> 来源:知乎\n> 著作权归作者所有,转载请联系作者获得授权。\n\n> 集成是指软件个人研发的部分向软件整体部分交付,以便尽早发现个人开发部分的问题;部署是代码尽快向可运行的开发/测试节交付,以便尽早测试;\n交付是指研发尽快向客户交付,以便尽早发现生产环境中存在的问题。\n如果说等到所有东西都完成了才向下个环节交付,导致所有的问题只能再最后才爆发出来,解决成本巨大甚至无法解决。\n而所谓的持续,就是说每完成一个完整的部分,就向下个环节交付,发现问题可以马上调整。是的问题不会放大到其他部分和后面的环节。\n\n> 这种做法的核心思想在于:既然事实上难以做到事先完全了解完整的、正确的需求,那么就干脆一小块一小块的做,并且加快交付的速度和频率,使得交付物尽早在下个环节得到验证。早发现问题早返工。\n\n> 举个例子,你家装修厨房,其中一项是铺地砖,边角地砖要切割大小。如果一次全切割完再铺上去,发现尺寸有误的话浪费和返工时间就大了,不如切一块铺一块。这就是持续集成。\n装修厨房有很多部分,每个部分都有检测手段,如地砖铺完了要测试漏水与否,线路铺完了要通电测试电路通顺,水管装好了也要测试冷水热水。如果全部装完了再测,出现问题可能会互相影响,比如电路不行可能要把地砖给挖开……。那么每完成一部分就测试,这是持续部署。\n全部装修完了,你去验收,发现地砖颜色不合意,水池太小,灶台位置不对,返工吗?所以不如没完成一部分,你就去用一下试用验收,这就是持续交付。\n\\--------------------\n补充:从敏捷思想中提出的这三个观点,还强调一件事:通过技术手段自动化这三个工作。加快交付速度。\n\n还有些细节可以参考[阮一峰的文章](http://www.ruanyifeng.com/blog/2015/09/continuous-integration.html)\n<!-- more -->\n\n![CI](/images/ci/flow.png)\n\n## 常用的持续集成工具\n- [Travis CI](https://travis-ci.org/) 针对开源项目免费,私有项目收费\n- [AppVeyou](https://www.appveyor.com/) 主要是windows平台的持续集成\n- [Gitlab CI](https://about.gitlab.com/gitlab-ci/) 私有仓库Gitlab自带的CI\n- [Jenkins](https://jenkins.io/index.html) 同样的开源产品,适合私有仓库使用,但是需要jre环境来部署\n\n## 项目实践\n- [vue-fullstack](https://github.com/erguotou520/vue-fullstack)\n 该项目为一个`vue`全栈项目模板,项目中使用`travis`做持续集成\n ```yaml\n language: node_js\n node_js:\n - \"6\"\n before_install:\n - git config --global push.default matching\n - git config --global user.name \"erguotou\"\n - git config --global user.email \"[email protected]\"\n install:\n - npm install -g vue-cli\n - npm install\n - node test/index.js\n script:\n - cd ../test-fullstack\n - npm install\n - npm run lint\n - npm run build\n cache:\n directories:\n - node_modules\n - ../test-fullstack/node_modules\n - $(npm config get prefix)/vue-cli\n ```\n 该配置文件中主要就做了一件事,根据当前模板生成一个项目文件并执行代码检查和构建操作,以此来简单地验证模板生成的正确性。\n *TODO:最好可以添加一个文件结构验证的代码,另外后续会根据生成后的项目自动push到github的其它分支中,并通过heroku实现自动部署*\n- [electron-ssr](https://github.com/erguotou520/electron-ssr) 该项目是`ShadowsocksR`的一个多平台pc客户端,该项目同时使用了`travis`和`appveyor`用来构建不同平台上的安装包文件,简单的看下配置文件\n ```yaml\n # travis\n osx_image: xcode7.3\n\n sudo: required\n dist: trusty\n\n language: c\n\n matrix:\n include:\n - os: osx\n - os: linux\n env: CC=clang CXX=clang++ npm_config_clang=1\n compiler: clang\n\n addons:\n apt:\n sources:\n - ubuntu-toolchain-r-test\n packages:\n - icnsutils\n - graphicsmagick\n - xz-utils\n - rpm\n\n cache:\n directories:\n - node_modules\n - app/node_modules\n - $HOME/.electron\n - $HOME/.cache\n\n before_install:\n - mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([ \"$TRAVIS_OS_NAME\" == \"linux\" ] && echo \"linux\" || echo \"darwin\")-amd64-1.2.1.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull\n\n install:\n - nvm install 6\n - npm install electron-builder\n - npm install\n - npm prune\n\n script:\n - npm run build\n\n branches:\n only:\n - master\n ```\n\n ```yaml\n version: 1.0.{build}\n\n platform:\n - x64\n\n cache:\n - node_modules\n - app\\node_modules\n - '%APPDATA%\\npm-cache'\n - '%USERPROFILE%\\.electron'\n\n branches:\n only:\n - master\n\n init:\n - git config --global core.autocrlf input\n\n install:\n - ps: Install-Product node 6 x64\n - git reset --hard HEAD\n - npm install npm -g\n - npm install electron-builder\n - npm install\n - npm prune\n\n build_script:\n - node --version\n - npm --version\n - npm run build\n ```\n 我们可以看到在`travis`中同时定义了Linux和Mac的构建任务,在`appveyor`中定义了Windows平台的构建任务。任务的大致流程都是根据当前的系统环境构建当前系统的安装包(打包App的任务由构建工具提供),然后自动发布到Gihub Release中,这样就实现了代码push->打包构建(全平台)->发布的完整过程,免去很多手动操作以及对系统环境的要求。\n- [vio-frontend]() T2Cloud的VIO产品前端代码,集成Gitlab CI实现自动编译并发布到poc环境,配置文件如下:\n ```yaml\n stages:\n - install_deps\n - lint\n # - test\n - build\n - deploy_poc\n # 安装依赖\n install_deps:\n stage: install_deps\n script:\n - npm install --registry=https://registry.npm.taobao.org\n lint:\n stage: lint\n script:\n - npm run lint\n # 运行测试用例\n # test:\n # stage: test\n # only:\n # - develop\n # - master\n # script:\n # - npm run test\n # 编译\n build:\n stage: build\n only:\n - develop\n - master\n script:\n - npm run build\n # 部署测试服务器\n deploy_test:\n stage: deploy_poc\n only:\n - develop\n script:\n - npm run deploy\n ```\n\n## 总结\n简单的说,持续集成帮助我们开发人员免去很重复的手工操作任务,同时可以帮我们持续观察项目的构建状态,测试通过与否,实在是我们开发之幸。\n","source":"_posts/ci.md","raw":"---\ntitle: CI简介和实际应用\ns: ci-intro\ndate: 2017-01-16 23:06:00\nthumbnail: /images/ci/flow.png\ntags:\n - ci\n - travis ci\n - gitlab ci\n---\n\n## 什么是CI\n引用知乎上的一个回答\n> 作者:赵劼\n> 链接:https://www.zhihu.com/question/23444990/answer/26995938\n> 来源:知乎\n> 著作权归作者所有,转载请联系作者获得授权。\n\n> 集成是指软件个人研发的部分向软件整体部分交付,以便尽早发现个人开发部分的问题;部署是代码尽快向可运行的开发/测试节交付,以便尽早测试;\n交付是指研发尽快向客户交付,以便尽早发现生产环境中存在的问题。\n如果说等到所有东西都完成了才向下个环节交付,导致所有的问题只能再最后才爆发出来,解决成本巨大甚至无法解决。\n而所谓的持续,就是说每完成一个完整的部分,就向下个环节交付,发现问题可以马上调整。是的问题不会放大到其他部分和后面的环节。\n\n> 这种做法的核心思想在于:既然事实上难以做到事先完全了解完整的、正确的需求,那么就干脆一小块一小块的做,并且加快交付的速度和频率,使得交付物尽早在下个环节得到验证。早发现问题早返工。\n\n> 举个例子,你家装修厨房,其中一项是铺地砖,边角地砖要切割大小。如果一次全切割完再铺上去,发现尺寸有误的话浪费和返工时间就大了,不如切一块铺一块。这就是持续集成。\n装修厨房有很多部分,每个部分都有检测手段,如地砖铺完了要测试漏水与否,线路铺完了要通电测试电路通顺,水管装好了也要测试冷水热水。如果全部装完了再测,出现问题可能会互相影响,比如电路不行可能要把地砖给挖开……。那么每完成一部分就测试,这是持续部署。\n全部装修完了,你去验收,发现地砖颜色不合意,水池太小,灶台位置不对,返工吗?所以不如没完成一部分,你就去用一下试用验收,这就是持续交付。\n\\--------------------\n补充:从敏捷思想中提出的这三个观点,还强调一件事:通过技术手段自动化这三个工作。加快交付速度。\n\n还有些细节可以参考[阮一峰的文章](http://www.ruanyifeng.com/blog/2015/09/continuous-integration.html)\n<!-- more -->\n\n![CI](/images/ci/flow.png)\n\n## 常用的持续集成工具\n- [Travis CI](https://travis-ci.org/) 针对开源项目免费,私有项目收费\n- [AppVeyou](https://www.appveyor.com/) 主要是windows平台的持续集成\n- [Gitlab CI](https://about.gitlab.com/gitlab-ci/) 私有仓库Gitlab自带的CI\n- [Jenkins](https://jenkins.io/index.html) 同样的开源产品,适合私有仓库使用,但是需要jre环境来部署\n\n## 项目实践\n- [vue-fullstack](https://github.com/erguotou520/vue-fullstack)\n 该项目为一个`vue`全栈项目模板,项目中使用`travis`做持续集成\n ```yaml\n language: node_js\n node_js:\n - \"6\"\n before_install:\n - git config --global push.default matching\n - git config --global user.name \"erguotou\"\n - git config --global user.email \"[email protected]\"\n install:\n - npm install -g vue-cli\n - npm install\n - node test/index.js\n script:\n - cd ../test-fullstack\n - npm install\n - npm run lint\n - npm run build\n cache:\n directories:\n - node_modules\n - ../test-fullstack/node_modules\n - $(npm config get prefix)/vue-cli\n ```\n 该配置文件中主要就做了一件事,根据当前模板生成一个项目文件并执行代码检查和构建操作,以此来简单地验证模板生成的正确性。\n *TODO:最好可以添加一个文件结构验证的代码,另外后续会根据生成后的项目自动push到github的其它分支中,并通过heroku实现自动部署*\n- [electron-ssr](https://github.com/erguotou520/electron-ssr) 该项目是`ShadowsocksR`的一个多平台pc客户端,该项目同时使用了`travis`和`appveyor`用来构建不同平台上的安装包文件,简单的看下配置文件\n ```yaml\n # travis\n osx_image: xcode7.3\n\n sudo: required\n dist: trusty\n\n language: c\n\n matrix:\n include:\n - os: osx\n - os: linux\n env: CC=clang CXX=clang++ npm_config_clang=1\n compiler: clang\n\n addons:\n apt:\n sources:\n - ubuntu-toolchain-r-test\n packages:\n - icnsutils\n - graphicsmagick\n - xz-utils\n - rpm\n\n cache:\n directories:\n - node_modules\n - app/node_modules\n - $HOME/.electron\n - $HOME/.cache\n\n before_install:\n - mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([ \"$TRAVIS_OS_NAME\" == \"linux\" ] && echo \"linux\" || echo \"darwin\")-amd64-1.2.1.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull\n\n install:\n - nvm install 6\n - npm install electron-builder\n - npm install\n - npm prune\n\n script:\n - npm run build\n\n branches:\n only:\n - master\n ```\n\n ```yaml\n version: 1.0.{build}\n\n platform:\n - x64\n\n cache:\n - node_modules\n - app\\node_modules\n - '%APPDATA%\\npm-cache'\n - '%USERPROFILE%\\.electron'\n\n branches:\n only:\n - master\n\n init:\n - git config --global core.autocrlf input\n\n install:\n - ps: Install-Product node 6 x64\n - git reset --hard HEAD\n - npm install npm -g\n - npm install electron-builder\n - npm install\n - npm prune\n\n build_script:\n - node --version\n - npm --version\n - npm run build\n ```\n 我们可以看到在`travis`中同时定义了Linux和Mac的构建任务,在`appveyor`中定义了Windows平台的构建任务。任务的大致流程都是根据当前的系统环境构建当前系统的安装包(打包App的任务由构建工具提供),然后自动发布到Gihub Release中,这样就实现了代码push->打包构建(全平台)->发布的完整过程,免去很多手动操作以及对系统环境的要求。\n- [vio-frontend]() T2Cloud的VIO产品前端代码,集成Gitlab CI实现自动编译并发布到poc环境,配置文件如下:\n ```yaml\n stages:\n - install_deps\n - lint\n # - test\n - build\n - deploy_poc\n # 安装依赖\n install_deps:\n stage: install_deps\n script:\n - npm install --registry=https://registry.npm.taobao.org\n lint:\n stage: lint\n script:\n - npm run lint\n # 运行测试用例\n # test:\n # stage: test\n # only:\n # - develop\n # - master\n # script:\n # - npm run test\n # 编译\n build:\n stage: build\n only:\n - develop\n - master\n script:\n - npm run build\n # 部署测试服务器\n deploy_test:\n stage: deploy_poc\n only:\n - develop\n script:\n - npm run deploy\n ```\n\n## 总结\n简单的说,持续集成帮助我们开发人员免去很重复的手工操作任务,同时可以帮我们持续观察项目的构建状态,测试通过与否,实在是我们开发之幸。\n","slug":"ci","published":1,"updated":"2020-03-25T04:59:57.915Z","comments":1,"layout":"post","photos":[],"link":"","_id":"ck86xh9ql00043nh5mmohh8ps","content":"<h2 id=\"什么是CI\"><a class=\"header-anchor\" href=\"#什么是CI\">¶</a>什么是CI</h2>\n<p>引用知乎上的一个回答</p>\n<blockquote>\n<p>作者:赵劼<br>\n链接:<a href=\"https://www.zhihu.com/question/23444990/answer/26995938\">https://www.zhihu.com/question/23444990/answer/26995938</a><br>\n来源:知乎<br>\n著作权归作者所有,转载请联系作者获得授权。</p>\n</blockquote>\n<blockquote>\n<p>集成是指软件个人研发的部分向软件整体部分交付,以便尽早发现个人开发部分的问题;部署是代码尽快向可运行的开发/测试节交付,以便尽早测试;<br>\n交付是指研发尽快向客户交付,以便尽早发现生产环境中存在的问题。<br>\n如果说等到所有东西都完成了才向下个环节交付,导致所有的问题只能再最后才爆发出来,解决成本巨大甚至无法解决。<br>\n而所谓的持续,就是说每完成一个完整的部分,就向下个环节交付,发现问题可以马上调整。是的问题不会放大到其他部分和后面的环节。</p>\n</blockquote>\n<blockquote>\n<p>这种做法的核心思想在于:既然事实上难以做到事先完全了解完整的、正确的需求,那么就干脆一小块一小块的做,并且加快交付的速度和频率,使得交付物尽早在下个环节得到验证。早发现问题早返工。</p>\n</blockquote>\n<blockquote>\n<p>举个例子,你家装修厨房,其中一项是铺地砖,边角地砖要切割大小。如果一次全切割完再铺上去,发现尺寸有误的话浪费和返工时间就大了,不如切一块铺一块。这就是持续集成。<br>\n装修厨房有很多部分,每个部分都有检测手段,如地砖铺完了要测试漏水与否,线路铺完了要通电测试电路通顺,水管装好了也要测试冷水热水。如果全部装完了再测,出现问题可能会互相影响,比如电路不行可能要把地砖给挖开……。那么每完成一部分就测试,这是持续部署。<br>\n全部装修完了,你去验收,发现地砖颜色不合意,水池太小,灶台位置不对,返工吗?所以不如没完成一部分,你就去用一下试用验收,这就是持续交付。<br>\n--------------------<br>\n补充:从敏捷思想中提出的这三个观点,还强调一件事:通过技术手段自动化这三个工作。加快交付速度。</p>\n</blockquote>\n<p>还有些细节可以参考<a href=\"http://www.ruanyifeng.com/blog/2015/09/continuous-integration.html\">阮一峰的文章</a></p>\n<a id=\"more\"></a>\n<p><img src=\"/images/ci/flow.png\" alt=\"CI\"></p>\n<h2 id=\"常用的持续集成工具\"><a class=\"header-anchor\" href=\"#常用的持续集成工具\">¶</a>常用的持续集成工具</h2>\n<ul>\n<li><a href=\"https://travis-ci.org/\">Travis CI</a> 针对开源项目免费,私有项目收费</li>\n<li><a href=\"https://www.appveyor.com/\">AppVeyou</a> 主要是windows平台的持续集成</li>\n<li><a href=\"https://about.gitlab.com/gitlab-ci/\">Gitlab CI</a> 私有仓库Gitlab自带的CI</li>\n<li><a href=\"https://jenkins.io/index.html\">Jenkins</a> 同样的开源产品,适合私有仓库使用,但是需要jre环境来部署</li>\n</ul>\n<h2 id=\"项目实践\"><a class=\"header-anchor\" href=\"#项目实践\">¶</a>项目实践</h2>\n<ul>\n<li>\n<p><a href=\"https://github.com/erguotou520/vue-fullstack\">vue-fullstack</a><br>\n该项目为一个<code>vue</code>全栈项目模板,项目中使用<code>travis</code>做持续集成</p>\n<figure class=\"highlight yaml hljs\"><table><tr><td class=\"gutter\"><pre><span class=\"line\">1</span><br><span class=\"line\">2</span><br><span class=\"line\">3</span><br><span class=\"line\">4</span><br><span class=\"line\">5</span><br><span class=\"line\">6</span><br><span class=\"line\">7</span><br><span class=\"line\">8</span><br><span class=\"line\">9</span><br><span class=\"line\">10</span><br><span class=\"line\">11</span><br><span class=\"line\">12</span><br><span class=\"line\">13</span><br><span class=\"line\">14</span><br><span class=\"line\">15</span><br><span class=\"line\">16</span><br><span class=\"line\">17</span><br><span class=\"line\">18</span><br><span class=\"line\">19</span><br><span class=\"line\">20</span><br><span class=\"line\">21</span><br></pre></td><td class=\"code\"><pre><span class=\"line\"><span class=\"hljs-attr\">language:</span> <span class=\"hljs-string\">node_js</span></span><br><span class=\"line\"><span class=\"hljs-attr\">node_js:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">\"6\"</span></span><br><span class=\"line\"><span class=\"hljs-attr\">before_install:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">git</span> <span class=\"hljs-string\">config</span> <span class=\"hljs-string\">--global</span> <span class=\"hljs-string\">push.default</span> <span class=\"hljs-string\">matching</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">git</span> <span class=\"hljs-string\">config</span> <span class=\"hljs-string\">--global</span> <span class=\"hljs-string\">user.name</span> <span class=\"hljs-string\">\"erguotou\"</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">git</span> <span class=\"hljs-string\">config</span> <span class=\"hljs-string\">--global</span> <span class=\"hljs-string\">user.email</span> <span class=\"hljs-string\">\"[email protected]\"</span></span><br><span class=\"line\"><span class=\"hljs-attr\">install:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">install</span> <span class=\"hljs-string\">-g</span> <span class=\"hljs-string\">vue-cli</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">install</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">node</span> <span class=\"hljs-string\">test/index.js</span></span><br><span class=\"line\"><span class=\"hljs-attr\">script:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">cd</span> <span class=\"hljs-string\">../test-fullstack</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">install</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">run</span> <span class=\"hljs-string\">lint</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">run</span> <span class=\"hljs-string\">build</span></span><br><span class=\"line\"><span class=\"hljs-attr\">cache:</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">directories:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">node_modules</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">../test-fullstack/node_modules</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">$(npm</span> <span class=\"hljs-string\">config</span> <span class=\"hljs-string\">get</span> <span class=\"hljs-string\">prefix)/vue-cli</span></span><br></pre></td></tr></table></figure>\n<p>该配置文件中主要就做了一件事,根据当前模板生成一个项目文件并执行代码检查和构建操作,以此来简单地验证模板生成的正确性。<br>\n<em>TODO:最好可以添加一个文件结构验证的代码,另外后续会根据生成后的项目自动push到github的其它分支中,并通过heroku实现自动部署</em></p>\n</li>\n<li>\n<p><a href=\"https://github.com/erguotou520/electron-ssr\">electron-ssr</a> 该项目是<code>ShadowsocksR</code>的一个多平台pc客户端,该项目同时使用了<code>travis</code>和<code>appveyor</code>用来构建不同平台上的安装包文件,简单的看下配置文件</p>\n<figure class=\"highlight yaml hljs\"><table><tr><td class=\"gutter\"><pre><span class=\"line\">1</span><br><span class=\"line\">2</span><br><span class=\"line\">3</span><br><span class=\"line\">4</span><br><span class=\"line\">5</span><br><span class=\"line\">6</span><br><span class=\"line\">7</span><br><span class=\"line\">8</span><br><span class=\"line\">9</span><br><span class=\"line\">10</span><br><span class=\"line\">11</span><br><span class=\"line\">12</span><br><span class=\"line\">13</span><br><span class=\"line\">14</span><br><span class=\"line\">15</span><br><span class=\"line\">16</span><br><span class=\"line\">17</span><br><span class=\"line\">18</span><br><span class=\"line\">19</span><br><span class=\"line\">20</span><br><span class=\"line\">21</span><br><span class=\"line\">22</span><br><span class=\"line\">23</span><br><span class=\"line\">24</span><br><span class=\"line\">25</span><br><span class=\"line\">26</span><br><span class=\"line\">27</span><br><span class=\"line\">28</span><br><span class=\"line\">29</span><br><span class=\"line\">30</span><br><span class=\"line\">31</span><br><span class=\"line\">32</span><br><span class=\"line\">33</span><br><span class=\"line\">34</span><br><span class=\"line\">35</span><br><span class=\"line\">36</span><br><span class=\"line\">37</span><br><span class=\"line\">38</span><br><span class=\"line\">39</span><br><span class=\"line\">40</span><br><span class=\"line\">41</span><br><span class=\"line\">42</span><br><span class=\"line\">43</span><br><span class=\"line\">44</span><br><span class=\"line\">45</span><br><span class=\"line\">46</span><br><span class=\"line\">47</span><br></pre></td><td class=\"code\"><pre><span class=\"line\"><span class=\"hljs-comment\"># travis</span></span><br><span class=\"line\"><span class=\"hljs-attr\">osx_image:</span> <span class=\"hljs-string\">xcode7.3</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">sudo:</span> <span class=\"hljs-string\">required</span></span><br><span class=\"line\"><span class=\"hljs-attr\">dist:</span> <span class=\"hljs-string\">trusty</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">language:</span> <span class=\"hljs-string\">c</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">matrix:</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">include:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">os:</span> <span class=\"hljs-string\">osx</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">os:</span> <span class=\"hljs-string\">linux</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">env:</span> <span class=\"hljs-string\">CC=clang</span> <span class=\"hljs-string\">CXX=clang++</span> <span class=\"hljs-string\">npm_config_clang=1</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">compiler:</span> <span class=\"hljs-string\">clang</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">addons:</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">apt:</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">sources:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">ubuntu-toolchain-r-test</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">packages:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">icnsutils</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">graphicsmagick</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">xz-utils</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">rpm</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">cache:</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">directories:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">node_modules</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">app/node_modules</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">$HOME/.electron</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">$HOME/.cache</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">before_install:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">mkdir</span> <span class=\"hljs-string\">-p</span> <span class=\"hljs-string\">/tmp/git-lfs</span> <span class=\"hljs-string\">&&</span> <span class=\"hljs-string\">curl</span> <span class=\"hljs-string\">-L</span> <span class=\"hljs-string\">https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([</span> <span class=\"hljs-string\">\"$TRAVIS_OS_NAME\"</span> <span class=\"hljs-string\">==</span> <span class=\"hljs-string\">\"linux\"</span> <span class=\"hljs-string\">]</span> <span class=\"hljs-string\">&&</span> <span class=\"hljs-string\">echo</span> <span class=\"hljs-string\">\"linux\"</span> <span class=\"hljs-string\">||</span> <span class=\"hljs-string\">echo</span> <span class=\"hljs-string\">\"darwin\"</span><span class=\"hljs-string\">)-amd64-1.2.1.tar.gz</span> <span class=\"hljs-string\">|</span> <span class=\"hljs-string\">tar</span> <span class=\"hljs-string\">-xz</span> <span class=\"hljs-string\">-C</span> <span class=\"hljs-string\">/tmp/git-lfs</span> <span class=\"hljs-string\">--strip-components</span> <span class=\"hljs-number\">1</span> <span class=\"hljs-string\">&&</span> <span class=\"hljs-string\">/tmp/git-lfs/git-lfs</span> <span class=\"hljs-string\">pull</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">install:</span></span><br><span class=\"line\"><span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">nvm</span> <span class=\"hljs-string\">install</span> <span class=\"hljs-number\">6</span></span><br><span class=\"line\"><span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">install</span> <span class=\"hljs-string\">electron-builder</span></span><br><span class=\"line\"><span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">install</span></span><br><span class=\"line\"><span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">prune</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">script:</span></span><br><span class=\"line\"><span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">run</span> <span class=\"hljs-string\">build</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">branches:</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">only:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">master</span></span><br></pre></td></tr></table></figure>\n<figure class=\"highlight yaml hljs\"><table><tr><td class=\"gutter\"><pre><span class=\"line\">1</span><br><span class=\"line\">2</span><br><span class=\"line\">3</span><br><span class=\"line\">4</span><br><span class=\"line\">5</span><br><span class=\"line\">6</span><br><span class=\"line\">7</span><br><span class=\"line\">8</span><br><span class=\"line\">9</span><br><span class=\"line\">10</span><br><span class=\"line\">11</span><br><span class=\"line\">12</span><br><span class=\"line\">13</span><br><span class=\"line\">14</span><br><span class=\"line\">15</span><br><span class=\"line\">16</span><br><span class=\"line\">17</span><br><span class=\"line\">18</span><br><span class=\"line\">19</span><br><span class=\"line\">20</span><br><span class=\"line\">21</span><br><span class=\"line\">22</span><br><span class=\"line\">23</span><br><span class=\"line\">24</span><br><span class=\"line\">25</span><br><span class=\"line\">26</span><br><span class=\"line\">27</span><br><span class=\"line\">28</span><br><span class=\"line\">29</span><br><span class=\"line\">30</span><br></pre></td><td class=\"code\"><pre><span class=\"line\"><span class=\"hljs-attr\">version:</span> <span class=\"hljs-number\">1.0</span><span class=\"hljs-string\">.{build}</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">platform:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">x64</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">cache:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">node_modules</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">app\\node_modules</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">'%APPDATA%\\npm-cache'</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">'%USERPROFILE%\\.electron'</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">branches:</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">only:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">master</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">init:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">git</span> <span class=\"hljs-string\">config</span> <span class=\"hljs-string\">--global</span> <span class=\"hljs-string\">core.autocrlf</span> <span class=\"hljs-string\">input</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">install:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-attr\">ps:</span> <span class=\"hljs-string\">Install-Product</span> <span class=\"hljs-string\">node</span> <span class=\"hljs-number\">6</span> <span class=\"hljs-string\">x64</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">git</span> <span class=\"hljs-string\">reset</span> <span class=\"hljs-string\">--hard</span> <span class=\"hljs-string\">HEAD</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">install</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">-g</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">install</span> <span class=\"hljs-string\">electron-builder</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">install</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">prune</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"hljs-attr\">build_script:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">node</span> <span class=\"hljs-string\">--version</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">--version</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">run</span> <span class=\"hljs-string\">build</span></span><br></pre></td></tr></table></figure>\n<p>我们可以看到在<code>travis</code>中同时定义了Linux和Mac的构建任务,在<code>appveyor</code>中定义了Windows平台的构建任务。任务的大致流程都是根据当前的系统环境构建当前系统的安装包(打包App的任务由构建工具提供),然后自动发布到Gihub Release中,这样就实现了代码push->打包构建(全平台)->发布的完整过程,免去很多手动操作以及对系统环境的要求。</p>\n</li>\n<li>\n<p><a href>vio-frontend</a> T2Cloud的VIO产品前端代码,集成Gitlab CI实现自动编译并发布到poc环境,配置文件如下:</p>\n<figure class=\"highlight yaml hljs\"><table><tr><td class=\"gutter\"><pre><span class=\"line\">1</span><br><span class=\"line\">2</span><br><span class=\"line\">3</span><br><span class=\"line\">4</span><br><span class=\"line\">5</span><br><span class=\"line\">6</span><br><span class=\"line\">7</span><br><span class=\"line\">8</span><br><span class=\"line\">9</span><br><span class=\"line\">10</span><br><span class=\"line\">11</span><br><span class=\"line\">12</span><br><span class=\"line\">13</span><br><span class=\"line\">14</span><br><span class=\"line\">15</span><br><span class=\"line\">16</span><br><span class=\"line\">17</span><br><span class=\"line\">18</span><br><span class=\"line\">19</span><br><span class=\"line\">20</span><br><span class=\"line\">21</span><br><span class=\"line\">22</span><br><span class=\"line\">23</span><br><span class=\"line\">24</span><br><span class=\"line\">25</span><br><span class=\"line\">26</span><br><span class=\"line\">27</span><br><span class=\"line\">28</span><br><span class=\"line\">29</span><br><span class=\"line\">30</span><br><span class=\"line\">31</span><br><span class=\"line\">32</span><br><span class=\"line\">33</span><br><span class=\"line\">34</span><br><span class=\"line\">35</span><br><span class=\"line\">36</span><br><span class=\"line\">37</span><br><span class=\"line\">38</span><br></pre></td><td class=\"code\"><pre><span class=\"line\"><span class=\"hljs-attr\">stages:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">install_deps</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">lint</span></span><br><span class=\"line\"> <span class=\"hljs-comment\"># - test</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">build</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">deploy_poc</span></span><br><span class=\"line\"><span class=\"hljs-comment\"># 安装依赖</span></span><br><span class=\"line\"><span class=\"hljs-attr\">install_deps:</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">stage:</span> <span class=\"hljs-string\">install_deps</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">script:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">install</span> <span class=\"hljs-string\">--registry=https://registry.npm.taobao.org</span></span><br><span class=\"line\"><span class=\"hljs-attr\">lint:</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">stage:</span> <span class=\"hljs-string\">lint</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">script:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">run</span> <span class=\"hljs-string\">lint</span></span><br><span class=\"line\"><span class=\"hljs-comment\"># 运行测试用例</span></span><br><span class=\"line\"><span class=\"hljs-comment\"># test:</span></span><br><span class=\"line\"><span class=\"hljs-comment\"># stage: test</span></span><br><span class=\"line\"><span class=\"hljs-comment\"># only:</span></span><br><span class=\"line\"><span class=\"hljs-comment\"># - develop</span></span><br><span class=\"line\"><span class=\"hljs-comment\"># - master</span></span><br><span class=\"line\"><span class=\"hljs-comment\"># script:</span></span><br><span class=\"line\"><span class=\"hljs-comment\"># - npm run test</span></span><br><span class=\"line\"><span class=\"hljs-comment\"># 编译</span></span><br><span class=\"line\"><span class=\"hljs-attr\">build:</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">stage:</span> <span class=\"hljs-string\">build</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">only:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">develop</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">master</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">script:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">run</span> <span class=\"hljs-string\">build</span></span><br><span class=\"line\"><span class=\"hljs-comment\"># 部署测试服务器</span></span><br><span class=\"line\"><span class=\"hljs-attr\">deploy_test:</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">stage:</span> <span class=\"hljs-string\">deploy_poc</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">only:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">develop</span></span><br><span class=\"line\"> <span class=\"hljs-attr\">script:</span></span><br><span class=\"line\"> <span class=\"hljs-bullet\">-</span> <span class=\"hljs-string\">npm</span> <span class=\"hljs-string\">run</span> <span class=\"hljs-string\">deploy</span></span><br></pre></td></tr></table></figure>\n</li>\n</ul>\n<h2 id=\"总结\"><a class=\"header-anchor\" href=\"#总结\">¶</a>总结</h2>\n<p>简单的说,持续集成帮助我们开发人员免去很重复的手工操作任务,同时可以帮我们持续观察项目的构建状态,测试通过与否,实在是我们开发之幸。</p>\n","site":{"data":{}},"excerpt":"<h2 id=\"什么是CI\"><a class=\"header-anchor\" href=\"#什么是CI\">¶</a>什么是CI</h2>\n<p>引用知乎上的一个回答</p>\n<blockquote>\n<p>作者:赵劼<br>\n链接:<a href=\"https://www.zhihu.com/question/23444990/answer/26995938\">https://www.zhihu.com/question/23444990/answer/26995938</a><br>\n来源:知乎<br>\n著作权归作者所有,转载请联系作者获得授权。</p>\n</blockquote>\n<blockquote>\n<p>集成是指软件个人研发的部分向软件整体部分交付,以便尽早发现个人开发部分的问题;部署是代码尽快向可运行的开发/测试节交付,以便尽早测试;<br>\n交付是指研发尽快向客户交付,以便尽早发现生产环境中存在的问题。<br>\n如果说等到所有东西都完成了才向下个环节交付,导致所有的问题只能再最后才爆发出来,解决成本巨大甚至无法解决。<br>\n而所谓的持续,就是说每完成一个完整的部分,就向下个环节交付,发现问题可以马上调整。是的问题不会放大到其他部分和后面的环节。</p>\n</blockquote>\n<blockquote>\n<p>这种做法的核心思想在于:既然事实上难以做到事先完全了解完整的、正确的需求,那么就干脆一小块一小块的做,并且加快交付的速度和频率,使得交付物尽早在下个环节得到验证。早发现问题早返工。</p>\n</blockquote>\n<blockquote>\n<p>举个例子,你家装修厨房,其中一项是铺地砖,边角地砖要切割大小。如果一次全切割完再铺上去,发现尺寸有误的话浪费和返工时间就大了,不如切一块铺一块。这就是持续集成。<br>\n装修厨房有很多部分,每个部分都有检测手段,如地砖铺完了要测试漏水与否,线路铺完了要通电测试电路通顺,水管装好了也要测试冷水热水。如果全部装完了再测,出现问题可能会互相影响,比如电路不行可能要把地砖给挖开……。那么每完成一部分就测试,这是持续部署。<br>\n全部装修完了,你去验收,发现地砖颜色不合意,水池太小,灶台位置不对,返工吗?所以不如没完成一部分,你就去用一下试用验收,这就是持续交付。<br>\n--------------------<br>\n补充:从敏捷思想中提出的这三个观点,还强调一件事:通过技术手段自动化这三个工作。加快交付速度。</p>\n</blockquote>\n<p>还有些细节可以参考<a href=\"http://www.ruanyifeng.com/blog/2015/09/continuous-integration.html\">阮一峰的文章</a></p>","more":"<p><img src=\"/images/ci/flow.png\" alt=\"CI\"></p>\n<h2 id=\"常用的持续集成工具\"><a class=\"header-anchor\" href=\"#常用的持续集成工具\">¶</a>常用的持续集成工具</h2>\n<ul>\n<li><a href=\"https://travis-ci.org/\">Travis CI</a> 针对开源项目免费,私有项目收费</li>\n<li><a href=\"https://www.appveyor.com/\">AppVeyou</a> 主要是windows平台的持续集成</li>\n<li><a href=\"https://about.gitlab.com/gitlab-ci/\">Gitlab CI</a> 私有仓库Gitlab自带的CI</li>\n<li><a href=\"https://jenkins.io/index.html\">Jenkins</a> 同样的开源产品,适合私有仓库使用,但是需要jre环境来部署</li>\n</ul>\n<h2 id=\"项目实践\"><a class=\"header-anchor\" href=\"#项目实践\">¶</a>项目实践</h2>\n<ul>\n<li>\n<p><a href=\"https://github.com/erguotou520/vue-fullstack\">vue-fullstack</a><br>\n该项目为一个<code>vue</code>全栈项目模板,项目中使用<code>travis</code>做持续集成</p>\n<figure class=\"highlight yaml\"><table><tr><td class=\"gutter\"><pre><span class=\"line\">1</span><br><span class=\"line\">2</span><br><span class=\"line\">3</span><br><span class=\"line\">4</span><br><span class=\"line\">5</span><br><span class=\"line\">6</span><br><span class=\"line\">7</span><br><span class=\"line\">8</span><br><span class=\"line\">9</span><br><span class=\"line\">10</span><br><span class=\"line\">11</span><br><span class=\"line\">12</span><br><span class=\"line\">13</span><br><span class=\"line\">14</span><br><span class=\"line\">15</span><br><span class=\"line\">16</span><br><span class=\"line\">17</span><br><span class=\"line\">18</span><br><span class=\"line\">19</span><br><span class=\"line\">20</span><br><span class=\"line\">21</span><br></pre></td><td class=\"code\"><pre><span class=\"line\"><span class=\"attr\">language:</span> <span class=\"string\">node_js</span></span><br><span class=\"line\"><span class=\"attr\">node_js:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">\"6\"</span></span><br><span class=\"line\"><span class=\"attr\">before_install:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">git</span> <span class=\"string\">config</span> <span class=\"string\">--global</span> <span class=\"string\">push.default</span> <span class=\"string\">matching</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">git</span> <span class=\"string\">config</span> <span class=\"string\">--global</span> <span class=\"string\">user.name</span> <span class=\"string\">\"erguotou\"</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">git</span> <span class=\"string\">config</span> <span class=\"string\">--global</span> <span class=\"string\">user.email</span> <span class=\"string\">\"[email protected]\"</span></span><br><span class=\"line\"><span class=\"attr\">install:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">install</span> <span class=\"string\">-g</span> <span class=\"string\">vue-cli</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">install</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">node</span> <span class=\"string\">test/index.js</span></span><br><span class=\"line\"><span class=\"attr\">script:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">cd</span> <span class=\"string\">../test-fullstack</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">install</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">run</span> <span class=\"string\">lint</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">run</span> <span class=\"string\">build</span></span><br><span class=\"line\"><span class=\"attr\">cache:</span></span><br><span class=\"line\"> <span class=\"attr\">directories:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">node_modules</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">../test-fullstack/node_modules</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">$(npm</span> <span class=\"string\">config</span> <span class=\"string\">get</span> <span class=\"string\">prefix)/vue-cli</span></span><br></pre></td></tr></table></figure>\n<p>该配置文件中主要就做了一件事,根据当前模板生成一个项目文件并执行代码检查和构建操作,以此来简单地验证模板生成的正确性。<br>\n<em>TODO:最好可以添加一个文件结构验证的代码,另外后续会根据生成后的项目自动push到github的其它分支中,并通过heroku实现自动部署</em></p>\n</li>\n<li>\n<p><a href=\"https://github.com/erguotou520/electron-ssr\">electron-ssr</a> 该项目是<code>ShadowsocksR</code>的一个多平台pc客户端,该项目同时使用了<code>travis</code>和<code>appveyor</code>用来构建不同平台上的安装包文件,简单的看下配置文件</p>\n<figure class=\"highlight yaml\"><table><tr><td class=\"gutter\"><pre><span class=\"line\">1</span><br><span class=\"line\">2</span><br><span class=\"line\">3</span><br><span class=\"line\">4</span><br><span class=\"line\">5</span><br><span class=\"line\">6</span><br><span class=\"line\">7</span><br><span class=\"line\">8</span><br><span class=\"line\">9</span><br><span class=\"line\">10</span><br><span class=\"line\">11</span><br><span class=\"line\">12</span><br><span class=\"line\">13</span><br><span class=\"line\">14</span><br><span class=\"line\">15</span><br><span class=\"line\">16</span><br><span class=\"line\">17</span><br><span class=\"line\">18</span><br><span class=\"line\">19</span><br><span class=\"line\">20</span><br><span class=\"line\">21</span><br><span class=\"line\">22</span><br><span class=\"line\">23</span><br><span class=\"line\">24</span><br><span class=\"line\">25</span><br><span class=\"line\">26</span><br><span class=\"line\">27</span><br><span class=\"line\">28</span><br><span class=\"line\">29</span><br><span class=\"line\">30</span><br><span class=\"line\">31</span><br><span class=\"line\">32</span><br><span class=\"line\">33</span><br><span class=\"line\">34</span><br><span class=\"line\">35</span><br><span class=\"line\">36</span><br><span class=\"line\">37</span><br><span class=\"line\">38</span><br><span class=\"line\">39</span><br><span class=\"line\">40</span><br><span class=\"line\">41</span><br><span class=\"line\">42</span><br><span class=\"line\">43</span><br><span class=\"line\">44</span><br><span class=\"line\">45</span><br><span class=\"line\">46</span><br><span class=\"line\">47</span><br></pre></td><td class=\"code\"><pre><span class=\"line\"><span class=\"comment\"># travis</span></span><br><span class=\"line\"><span class=\"attr\">osx_image:</span> <span class=\"string\">xcode7.3</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">sudo:</span> <span class=\"string\">required</span></span><br><span class=\"line\"><span class=\"attr\">dist:</span> <span class=\"string\">trusty</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">language:</span> <span class=\"string\">c</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">matrix:</span></span><br><span class=\"line\"> <span class=\"attr\">include:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"attr\">os:</span> <span class=\"string\">osx</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"attr\">os:</span> <span class=\"string\">linux</span></span><br><span class=\"line\"> <span class=\"attr\">env:</span> <span class=\"string\">CC=clang</span> <span class=\"string\">CXX=clang++</span> <span class=\"string\">npm_config_clang=1</span></span><br><span class=\"line\"> <span class=\"attr\">compiler:</span> <span class=\"string\">clang</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">addons:</span></span><br><span class=\"line\"> <span class=\"attr\">apt:</span></span><br><span class=\"line\"> <span class=\"attr\">sources:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">ubuntu-toolchain-r-test</span></span><br><span class=\"line\"> <span class=\"attr\">packages:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">icnsutils</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">graphicsmagick</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">xz-utils</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">rpm</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">cache:</span></span><br><span class=\"line\"> <span class=\"attr\">directories:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">node_modules</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">app/node_modules</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">$HOME/.electron</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">$HOME/.cache</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">before_install:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">mkdir</span> <span class=\"string\">-p</span> <span class=\"string\">/tmp/git-lfs</span> <span class=\"string\">&&</span> <span class=\"string\">curl</span> <span class=\"string\">-L</span> <span class=\"string\">https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([</span> <span class=\"string\">\"$TRAVIS_OS_NAME\"</span> <span class=\"string\">==</span> <span class=\"string\">\"linux\"</span> <span class=\"string\">]</span> <span class=\"string\">&&</span> <span class=\"string\">echo</span> <span class=\"string\">\"linux\"</span> <span class=\"string\">||</span> <span class=\"string\">echo</span> <span class=\"string\">\"darwin\"</span><span class=\"string\">)-amd64-1.2.1.tar.gz</span> <span class=\"string\">|</span> <span class=\"string\">tar</span> <span class=\"string\">-xz</span> <span class=\"string\">-C</span> <span class=\"string\">/tmp/git-lfs</span> <span class=\"string\">--strip-components</span> <span class=\"number\">1</span> <span class=\"string\">&&</span> <span class=\"string\">/tmp/git-lfs/git-lfs</span> <span class=\"string\">pull</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">install:</span></span><br><span class=\"line\"><span class=\"bullet\">-</span> <span class=\"string\">nvm</span> <span class=\"string\">install</span> <span class=\"number\">6</span></span><br><span class=\"line\"><span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">install</span> <span class=\"string\">electron-builder</span></span><br><span class=\"line\"><span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">install</span></span><br><span class=\"line\"><span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">prune</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">script:</span></span><br><span class=\"line\"><span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">run</span> <span class=\"string\">build</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">branches:</span></span><br><span class=\"line\"> <span class=\"attr\">only:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">master</span></span><br></pre></td></tr></table></figure>\n<figure class=\"highlight yaml\"><table><tr><td class=\"gutter\"><pre><span class=\"line\">1</span><br><span class=\"line\">2</span><br><span class=\"line\">3</span><br><span class=\"line\">4</span><br><span class=\"line\">5</span><br><span class=\"line\">6</span><br><span class=\"line\">7</span><br><span class=\"line\">8</span><br><span class=\"line\">9</span><br><span class=\"line\">10</span><br><span class=\"line\">11</span><br><span class=\"line\">12</span><br><span class=\"line\">13</span><br><span class=\"line\">14</span><br><span class=\"line\">15</span><br><span class=\"line\">16</span><br><span class=\"line\">17</span><br><span class=\"line\">18</span><br><span class=\"line\">19</span><br><span class=\"line\">20</span><br><span class=\"line\">21</span><br><span class=\"line\">22</span><br><span class=\"line\">23</span><br><span class=\"line\">24</span><br><span class=\"line\">25</span><br><span class=\"line\">26</span><br><span class=\"line\">27</span><br><span class=\"line\">28</span><br><span class=\"line\">29</span><br><span class=\"line\">30</span><br></pre></td><td class=\"code\"><pre><span class=\"line\"><span class=\"attr\">version:</span> <span class=\"number\">1.0</span><span class=\"string\">.{build}</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">platform:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">x64</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">cache:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">node_modules</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">app\\node_modules</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">'%APPDATA%\\npm-cache'</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">'%USERPROFILE%\\.electron'</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">branches:</span></span><br><span class=\"line\"> <span class=\"attr\">only:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">master</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">init:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">git</span> <span class=\"string\">config</span> <span class=\"string\">--global</span> <span class=\"string\">core.autocrlf</span> <span class=\"string\">input</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">install:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"attr\">ps:</span> <span class=\"string\">Install-Product</span> <span class=\"string\">node</span> <span class=\"number\">6</span> <span class=\"string\">x64</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">git</span> <span class=\"string\">reset</span> <span class=\"string\">--hard</span> <span class=\"string\">HEAD</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">install</span> <span class=\"string\">npm</span> <span class=\"string\">-g</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">install</span> <span class=\"string\">electron-builder</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">install</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">prune</span></span><br><span class=\"line\"></span><br><span class=\"line\"><span class=\"attr\">build_script:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">node</span> <span class=\"string\">--version</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">--version</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">run</span> <span class=\"string\">build</span></span><br></pre></td></tr></table></figure>\n<p>我们可以看到在<code>travis</code>中同时定义了Linux和Mac的构建任务,在<code>appveyor</code>中定义了Windows平台的构建任务。任务的大致流程都是根据当前的系统环境构建当前系统的安装包(打包App的任务由构建工具提供),然后自动发布到Gihub Release中,这样就实现了代码push->打包构建(全平台)->发布的完整过程,免去很多手动操作以及对系统环境的要求。</p>\n</li>\n<li>\n<p><a href=\"\">vio-frontend</a> T2Cloud的VIO产品前端代码,集成Gitlab CI实现自动编译并发布到poc环境,配置文件如下:</p>\n<figure class=\"highlight yaml\"><table><tr><td class=\"gutter\"><pre><span class=\"line\">1</span><br><span class=\"line\">2</span><br><span class=\"line\">3</span><br><span class=\"line\">4</span><br><span class=\"line\">5</span><br><span class=\"line\">6</span><br><span class=\"line\">7</span><br><span class=\"line\">8</span><br><span class=\"line\">9</span><br><span class=\"line\">10</span><br><span class=\"line\">11</span><br><span class=\"line\">12</span><br><span class=\"line\">13</span><br><span class=\"line\">14</span><br><span class=\"line\">15</span><br><span class=\"line\">16</span><br><span class=\"line\">17</span><br><span class=\"line\">18</span><br><span class=\"line\">19</span><br><span class=\"line\">20</span><br><span class=\"line\">21</span><br><span class=\"line\">22</span><br><span class=\"line\">23</span><br><span class=\"line\">24</span><br><span class=\"line\">25</span><br><span class=\"line\">26</span><br><span class=\"line\">27</span><br><span class=\"line\">28</span><br><span class=\"line\">29</span><br><span class=\"line\">30</span><br><span class=\"line\">31</span><br><span class=\"line\">32</span><br><span class=\"line\">33</span><br><span class=\"line\">34</span><br><span class=\"line\">35</span><br><span class=\"line\">36</span><br><span class=\"line\">37</span><br><span class=\"line\">38</span><br></pre></td><td class=\"code\"><pre><span class=\"line\"><span class=\"attr\">stages:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">install_deps</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">lint</span></span><br><span class=\"line\"> <span class=\"comment\"># - test</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">build</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">deploy_poc</span></span><br><span class=\"line\"><span class=\"comment\"># 安装依赖</span></span><br><span class=\"line\"><span class=\"attr\">install_deps:</span></span><br><span class=\"line\"> <span class=\"attr\">stage:</span> <span class=\"string\">install_deps</span></span><br><span class=\"line\"> <span class=\"attr\">script:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">install</span> <span class=\"string\">--registry=https://registry.npm.taobao.org</span></span><br><span class=\"line\"><span class=\"attr\">lint:</span></span><br><span class=\"line\"> <span class=\"attr\">stage:</span> <span class=\"string\">lint</span></span><br><span class=\"line\"> <span class=\"attr\">script:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">run</span> <span class=\"string\">lint</span></span><br><span class=\"line\"><span class=\"comment\"># 运行测试用例</span></span><br><span class=\"line\"><span class=\"comment\"># test:</span></span><br><span class=\"line\"><span class=\"comment\"># stage: test</span></span><br><span class=\"line\"><span class=\"comment\"># only:</span></span><br><span class=\"line\"><span class=\"comment\"># - develop</span></span><br><span class=\"line\"><span class=\"comment\"># - master</span></span><br><span class=\"line\"><span class=\"comment\"># script:</span></span><br><span class=\"line\"><span class=\"comment\"># - npm run test</span></span><br><span class=\"line\"><span class=\"comment\"># 编译</span></span><br><span class=\"line\"><span class=\"attr\">build:</span></span><br><span class=\"line\"> <span class=\"attr\">stage:</span> <span class=\"string\">build</span></span><br><span class=\"line\"> <span class=\"attr\">only:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">develop</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">master</span></span><br><span class=\"line\"> <span class=\"attr\">script:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">run</span> <span class=\"string\">build</span></span><br><span class=\"line\"><span class=\"comment\"># 部署测试服务器</span></span><br><span class=\"line\"><span class=\"attr\">deploy_test:</span></span><br><span class=\"line\"> <span class=\"attr\">stage:</span> <span class=\"string\">deploy_poc</span></span><br><span class=\"line\"> <span class=\"attr\">only:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">develop</span></span><br><span class=\"line\"> <span class=\"attr\">script:</span></span><br><span class=\"line\"> <span class=\"bullet\">-</span> <span class=\"string\">npm</span> <span class=\"string\">run</span> <span class=\"string\">deploy</span></span><br></pre></td></tr></table></figure>\n</li>\n</ul>\n<h2 id=\"总结\"><a class=\"header-anchor\" href=\"#总结\">¶</a>总结</h2>\n<p>简单的说,持续集成帮助我们开发人员免去很重复的手工操作任务,同时可以帮我们持续观察项目的构建状态,测试通过与否,实在是我们开发之幸。</p>"}],"PostAsset":[],"PostCategory":[],"PostTag":[{"post_id":"ck86xh9qj00023nh53ukrzl1j","tag_id":"ck86xh9qm00053nh56qotc5wk","_id":"ck86xh9qp000a3nh5zvj8xorw"},{"post_id":"ck86xh9qj00023nh53ukrzl1j","tag_id":"ck86xh9qo00063nh5adhz0ml0","_id":"ck86xh9qp000b3nh5rmwg7yh4"},{"post_id":"ck86xh9qj00023nh53ukrzl1j","tag_id":"ck86xh9qo00073nh5xfqf8d76","_id":"ck86xh9qp000d3nh5vicflr61"},{"post_id":"ck86xh9qj00023nh53ukrzl1j","tag_id":"ck86xh9qo00083nh5rqanhm9b","_id":"ck86xh9qp000e3nh5jjqua6cf"},{"post_id":"ck86xh9ql00043nh5mmohh8ps","tag_id":"ck86xh9qp00093nh5phpu0e5d","_id":"ck86xh9qq000g3nh59ind9oo4"},{"post_id":"ck86xh9ql00043nh5mmohh8ps","tag_id":"ck86xh9qp000c3nh5cbow8mus","_id":"ck86xh9qq000h3nh54mpa44ks"},{"post_id":"ck86xh9ql00043nh5mmohh8ps","tag_id":"ck86xh9qp000f3nh5q0yapvuw","_id":"ck86xh9qq000i3nh5rg0pdicu"}],"Tag":[{"name":"git","_id":"ck86xh9qm00053nh56qotc5wk"},{"name":"gitea","_id":"ck86xh9qo00063nh5adhz0ml0"},{"name":"linux","_id":"ck86xh9qo00073nh5xfqf8d76"},{"name":"服务器","_id":"ck86xh9qo00083nh5rqanhm9b"},{"name":"ci","_id":"ck86xh9qp00093nh5phpu0e5d"},{"name":"travis ci","_id":"ck86xh9qp000c3nh5cbow8mus"},{"name":"gitlab ci","_id":"ck86xh9qp000f3nh5q0yapvuw"}]}}