@serverless-devs/s 2.0.92 → 2.0.93-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CONTRIBUTORS.md +2 -0
  2. package/bin/s-component +2 -0
  3. package/bin/s-set-workspace +2 -0
  4. package/docs/readme.md +94 -0
  5. package/docs/zh/awesome.md +296 -0
  6. package/docs/zh/cicd.md +200 -0
  7. package/docs/zh/cli_design.md +100 -0
  8. package/docs/zh/command/clean.md +63 -0
  9. package/docs/zh/command/cli.md +92 -0
  10. package/docs/zh/command/component.md +76 -0
  11. package/docs/zh/command/config.md +278 -0
  12. package/docs/zh/command/custom.md +73 -0
  13. package/docs/zh/command/init.md +148 -0
  14. package/docs/zh/command/readme.md +76 -0
  15. package/docs/zh/command/set.md +195 -0
  16. package/docs/zh/default_provider_config/alibabacloud.md +82 -0
  17. package/docs/zh/default_provider_config/aws.md +12 -0
  18. package/docs/zh/default_provider_config/azure.md +9 -0
  19. package/docs/zh/default_provider_config/baiducloud.md +8 -0
  20. package/docs/zh/default_provider_config/gcp.md +21 -0
  21. package/docs/zh/default_provider_config/huaweicloud.md +52 -0
  22. package/docs/zh/default_provider_config/readme.md +9 -0
  23. package/docs/zh/default_provider_config/tencentcloud.md +41 -0
  24. package/docs/zh/install.md +52 -0
  25. package/docs/zh/package_dev.md +142 -0
  26. package/docs/zh/quick_start.md +297 -0
  27. package/docs/zh/readme.md +90 -0
  28. package/docs/zh/tool.md +80 -0
  29. package/docs/zh/yaml.md +203 -0
  30. package/docs/zh/yaml_and_cli.md +67 -0
  31. package/lib/clean/index.js +43 -35
  32. package/lib/cli/cli-manager.js +33 -22
  33. package/lib/cli/index.js +60 -62
  34. package/lib/component/index.d.ts +1 -0
  35. package/lib/component/index.js +161 -0
  36. package/lib/config/add/index.js +39 -39
  37. package/lib/config/delete/index.js +49 -59
  38. package/lib/config/get/index.d.ts +0 -1
  39. package/lib/config/get/index.js +46 -51
  40. package/lib/config/index.js +36 -35
  41. package/lib/constants/index.d.ts +0 -1
  42. package/lib/constants/index.js +1 -5
  43. package/lib/core/command/command-manager.js +36 -43
  44. package/lib/core/component/index.d.ts +14 -7
  45. package/lib/core/component/index.js +78 -52
  46. package/lib/core/plugin/index.js +4 -3
  47. package/lib/daemon/template.js +2 -4
  48. package/lib/error/human-error.d.ts +12 -2
  49. package/lib/error/human-error.js +63 -28
  50. package/lib/error/human-warning.d.ts +8 -0
  51. package/lib/error/human-warning.js +19 -0
  52. package/lib/error/index.d.ts +10 -1
  53. package/lib/error/index.js +74 -27
  54. package/lib/index.js +89 -94
  55. package/lib/init/index.js +76 -79
  56. package/lib/init/init-config.js +3 -5
  57. package/lib/init/init-manager.js +3 -4
  58. package/lib/init/update-template.js +3 -5
  59. package/lib/onboarding/index.js +5 -5
  60. package/lib/set/analysis/index.js +41 -37
  61. package/lib/set/index.js +34 -33
  62. package/lib/set/locale/index.js +54 -53
  63. package/lib/set/registry/index.js +52 -52
  64. package/lib/set/workspace/index.d.ts +1 -0
  65. package/lib/set/workspace/index.js +61 -0
  66. package/lib/specification/parse.js +9 -6
  67. package/lib/update-notifier/index.js +10 -10
  68. package/lib/utils/command-util.d.ts +0 -2
  69. package/lib/utils/command-util.js +2 -42
  70. package/lib/utils/common.d.ts +1 -0
  71. package/lib/utils/common.js +100 -20
  72. package/lib/utils/core.js +3 -3
  73. package/lib/utils/handler-set-config.d.ts +1 -1
  74. package/lib/utils/handler-set-config.js +6 -7
  75. package/lib/utils/i18n/en.js +4 -4
  76. package/lib/utils/i18n/index.js +3 -3
  77. package/lib/utils/i18n/zh.js +3 -3
  78. package/lib/utils/storage.js +3 -4
  79. package/package.json +2 -2
  80. package/readme.md +64 -38
  81. package/shell/postbuild.sh +2 -0
  82. package/spec/readme.md +59 -0
  83. package/spec/zh/0.0.1/readme.md +47 -0
  84. package/spec/zh/0.0.1/serverless_pacakge_model/1.purpose_and_goals.md +3 -0
  85. package/spec/zh/0.0.1/serverless_pacakge_model/2.overview_and_terminology.md +14 -0
  86. package/spec/zh/0.0.1/serverless_pacakge_model/3.package_model.md +434 -0
  87. package/spec/zh/0.0.1/serverless_pacakge_model/4.application_scopes.md +3 -0
  88. package/spec/zh/0.0.1/serverless_pacakge_model/5.design_principles.md +3 -0
  89. package/spec/zh/0.0.1/serverless_pacakge_model/readme.md +12 -0
  90. package/spec/zh/0.0.1/serverless_registry_model/1.purpose_and_goals.md +18 -0
  91. package/spec/zh/0.0.1/serverless_registry_model/2.overview_and_terminology.md +18 -0
  92. package/spec/zh/0.0.1/serverless_registry_model/3.registry_model.md +61 -0
  93. package/spec/zh/0.0.1/serverless_registry_model/4.application_scopes.md +6 -0
  94. package/spec/zh/0.0.1/serverless_registry_model/5.design_principles.md +3 -0
  95. package/spec/zh/0.0.1/serverless_registry_model/readme.md +12 -0
  96. package/spec/zh/0.0.1/serverless_user_model/1.purpose_and_goals.md +3 -0
  97. package/spec/zh/0.0.1/serverless_user_model/2.overview_and_terminology.md +16 -0
  98. package/spec/zh/0.0.1/serverless_user_model/3.user_model.md +218 -0
  99. package/spec/zh/0.0.1/serverless_user_model/4.application_scopes.md +4 -0
  100. package/spec/zh/0.0.1/serverless_user_model/5.design_principles.md +3 -0
  101. package/spec/zh/0.0.1/serverless_user_model/readme.md +12 -0
  102. package/bin/s-set-locale +0 -2
  103. package/readme_zh.md +0 -72
package/CONTRIBUTORS.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  > Thank you for your support and recognition of serverless devs. Serverless devs is committed to creating an active and open serverless developer ecosystem, providing more simple and easy-to-use serverless developer tools for more serverless developers.
4
4
 
5
+ > If you also contributed to this project, but there is no your name below, please add your information at the end in order and submit [Pull Requests](https://github.com/Serverless-Devs/Serverless-Devs/pulls) to us
6
+
5
7
  <center>
6
8
  <table>
7
9
  <tr>
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ require('../lib/component');
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ require('../lib/set/workspace');
package/docs/readme.md ADDED
@@ -0,0 +1,94 @@
1
+ <div align=center> <img src="https://images.devsapp.cn/devs-github/logo.jpg" width="100%"/> </div>
2
+ <br>
3
+ <p align="center">
4
+ <a href="https://www.npmjs.com/package/@serverless-devs/s">
5
+ <img src="https://img.shields.io/npm/v/@serverless-devs/s" alt="npm version">
6
+ </a>
7
+ <a href="https://www.npmjs.com/package/@serverless-devs/s">
8
+ <img src="https://img.shields.io/npm/dy/@serverless-devs/s" alt="npm download">
9
+ </a>
10
+ <a href="https://nodejs.org/en/">
11
+ <img src="https://img.shields.io/badge/node-%3E%3D%2010.8.0-brightgreen" alt="node.js version">
12
+ </a>
13
+ <a href="https://github.com/Serverless-Devs/Serverless-Devs/blob/master/LICENSE">
14
+ <img src="https://img.shields.io/badge/License-MIT-green" alt="license">
15
+ </a>
16
+ <a href="https://github.com/Serverless-Devs/Serverless-Devs/issues">
17
+ <img src="https://img.shields.io/github/issues/serverless-devs/serverless-devs" alt="issues">
18
+ </a>
19
+ <a href="https://github.com/Serverless-Devs/Serverless-Devs/discussions">
20
+ <img src="https://img.shields.io/github/discussions/serverless-devs/serverless-devs" alt="discussions">
21
+ </a>
22
+ </p>
23
+
24
+ <p align="center">
25
+ <span><b>Serverless 应用全生命周期管理工具</b></span><br>
26
+ </p>
27
+
28
+ **Serverless Devs** 是一个开源开放的 Serverless 开发者平台,致力于为开发者提供强大的工具链体系。通过该平台,开发者不仅可以一键体验多云 Serverless 产品,极速部署 Serverless 项目,还可以在 Serverless 应用全生命周期进行项目的管理,并且非常简单快速的将 Serverless Devs 与其他工具/平台进行结合,进一步提升研发、运维效能。
29
+
30
+ ![图片alt](https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635319587379_20211027072627561648.png)
31
+
32
+ > 更多关于 Serverless Devs 的介绍可以参考[项目介绍文档](./zh/readme.md)
33
+
34
+ # 快速上手
35
+
36
+ ❶ 安装 Node.js(>=10.8.0) 与 NPM 包管理工具;
37
+ ❷ 安装 Serverless Devs 开发者工具;
38
+ ```shell script
39
+ $ npm install @serverless-devs/s -g
40
+ ```
41
+ ❸ 在命令行中执行命令`s`,并按回车,开启你的 Serverless 之旅;
42
+
43
+ > 更多详细信息可以参考[Serverless Devs 安装文档](./zh/install.md)和[快速入门指南](./zh/quick_start.md)
44
+
45
+ # 帮助文档
46
+
47
+ - [安装文档](zh/install.md)
48
+ - [命令行操作](zh/command/readme.md)
49
+ - [Yaml规范](zh/yaml.md)
50
+ - [CI/CD平台集成](zh/cicd.md)
51
+
52
+ > 如果您想为 Serverless Devs 贡献 Package(包括组件和应用),您可以参考 [Package开发文档](zh/package_dev.md)
53
+
54
+ > Serverless Devs 天然支持 Yaml 模式与 Cli 模式,关于两者的区别和试用场景,可以参考文档[ Yaml 模式 Cli 模式对比](./../yaml_and_cli.md)
55
+
56
+ # 相关资源
57
+
58
+ 目前 Serverless Devs 项目已经支持的 FaaS 平台/产品:
59
+
60
+ - 阿里云函数计算(FC): [项目仓库](https://github.com/devsapp/fc)
61
+ - AWS Lambda: [项目仓库](https://github.com/devscomp/lambda)
62
+ - 百度智能云函数计算(CFC): [项目仓库](https://github.com/xinwuyun/cfc)
63
+ - 华为云函数工作流(FG): [项目仓库](https://github.com/xinwuyun/fg)
64
+ - 腾讯云云函数(SCF): [项目仓库](https://github.com/devscomp/scf)
65
+
66
+ > 尽管以上 FaaS 平台/产品已经有人贡献或在持续维护中,但是我们仍然非常欢迎大家可以参与贡献/维护,除此之外,其他的 FaaS 平台/产品(例如 Google Cloud Platform Functions、Azure Functions等),我们也非常期望社区的小伙伴们可以参与开发和贡献。
67
+
68
+ > 🚀 除此之外 Serverless Devs 项目还拥有很多优秀的组件和应用,可以参考[Awesome](./zh/awesome.md)
69
+
70
+ # 项目贡献
71
+
72
+ 我们非常希望您可以和我们一起贡献这个项目。贡献内容包括不限于代码的维护、应用/组件的贡献、文档的完善等,更多详情可以参考[ 🏆 贡献指南](../CONTRIBUTING.md)。
73
+
74
+ 与此同时,我们也非常感谢所有[ 👬 参与贡献的小伙伴](../CONTRIBUTORS.md),为 Serverless Devs 项目贡献的努力和汗水。
75
+
76
+ # 开源许可
77
+
78
+ Serverless Devs 遵循 [MIT License](../LICENSE) 开源许可。
79
+
80
+ 位于`node_modules`和外部目录中的所有文件都是本软件使用的外部维护库,具有自己的许可证;我们建议您阅读它们,因为它们的条款可能与[MIT License](../LICENSE)的条款不同。
81
+
82
+ # 交流社区
83
+
84
+ <p align="center">
85
+
86
+ | <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407298906_20211028074819117230.png" width="200px" > | <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407044136_20211028074404326599.png" width="200px" > | <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407252200_20211028074732517533.png" width="200px" > |
87
+ |--- | --- | --- |
88
+ | <center>关注微信公众号:`serverless`</center> | <center>联系微信小助手:`xiaojiangwh`</center> | <center>加入钉钉交流群:`33947367`</center> |
89
+
90
+ </p>
91
+
92
+ -----------
93
+
94
+ > Serverless Devs 开发者工具遵循 [Serverless Devs Model](../spec/readme.md),更多模型/规范信息可以参考 [Serverless Registry Model](../spec/zh/0.0.1/serverless_registry_model/readme.md),[Serverless User Model](../spec/zh/0.0.1/serverless_user_model/readme.md) 以及 [Serverless Package Model](../spec/zh/0.0.1/serverless_pacakge_model/readme.md);另外,关于项目设计的一些细节可以参考[开发者工具设计文档](./zh/tool.md)
@@ -0,0 +1,296 @@
1
+ # Package Awesome
2
+
3
+ - [应用集合](#应用集合)
4
+ - [组件集合](#组件集合)
5
+
6
+
7
+ # 应用集合
8
+
9
+ ## Web Framework应用案例
10
+
11
+ <table>
12
+ <tr>
13
+ <th>No.</th>
14
+ <th>:fire:Nodejs</th>
15
+ <th>Python</th>
16
+ <th>PHP</th>
17
+ <th>Go</th>
18
+ <th>Java</th>
19
+ <th>Others</th>
20
+ </tr>
21
+ <tr>
22
+ <td align="center">1</td>
23
+ <td align="center">:fire:<a href="https://github.com/devsapp/start-express">Express</a></td>
24
+ <td align="center">:fire::fire:<a href="https://github.com/devsapp/start-flask">Flask</a></td>
25
+ <td align="center"><a href="https://github.com/devsapp/start-thinkphp">Think PHP</a></td>
26
+ <td align="center">BeeGo</td>
27
+ <td align="center">Tomcat/Jetty</td>
28
+ <td align="center">Gatsby</td>
29
+ </tr>
30
+ <tr>
31
+ <td align="center">2</td>
32
+ <td align="center"><a href="https://github.com/devsapp/start-egg">Egg</a></td>
33
+ <td align="center"><a href="https://github.com/devsapp/start-tornado">Tornado</a></td>
34
+ <td align="center"><a href="https://github.com/devsapp/start-laravel">laravel</a></td>
35
+ <td align="center">Gin</td>
36
+ <td align="center"><a href="https://github.com/devsapp/start-springboot">Spring Boot</a></td><td>Hugo</td>
37
+ </tr>
38
+ <tr>
39
+ <td align="center">3</td>
40
+ <td align="center"><a href="https://github.com/devsapp/start-next">Nextjs</a></td>
41
+ <td align="center"><a href="https://github.com/devsapp/start-bottle">Bottle</a></td>
42
+ <td align="center"><a href="https://github.com/devsapp/start-discuz">Discuz</a></td><td></td><td align="center">Quarkus</td>
43
+ <td align="center"></td>
44
+ </tr>
45
+ <tr>
46
+ <td align="center">4</td>
47
+ <td align="center"><a href="https://github.com/devsapp/start-nuxt">Nuxtjs(Container)</a><br><a href="https://github.com/devsapp/custom-nuxt">Nuxtjs(Custom)</a></td>
48
+ <td align="center"><a href="https://github.com/devsapp/start-webpy">Web.py</a></td>
49
+ <td align="center"> :fire::fire::fire: <a href="https://github.com/devsapp/start-wordpress" >WordPress</a></td><td></td><td></td>
50
+ <td align="center"></td>
51
+ </tr>
52
+ <tr>
53
+ <td align="center">5</td>
54
+ <td align="center"> :fire::fire::fire: <a href="https://github.com/devsapp/start-hexo" >Hexo</a></td>
55
+ <td align="center"><a href="https://github.com/devsapp/start-django" >Django</a></td>
56
+ <td align="center"> :fire::fire::fire: <a href="https://github.com/devsapp/start-zblog" >Zblog</a></td><td></td><td></td>
57
+ <td align="center"></td>
58
+ </tr>
59
+ <tr>
60
+ <td align="center">6</td>
61
+ <td align="center"><a href="https://github.com/devsapp/start-koa">Koa(Container)</a><br><a href="https://github.com/devsapp/nodejs-koa">Koa(Node.js Runtime)</a></td>
62
+ <td align="center">FastAPI</td>
63
+ <td align="center"><a href="https://github.com/devsapp/start-ecshop" >Ecshop</a></td><td></td><td></td><td></td>
64
+ </tr>
65
+ <tr>
66
+ <td align="center">7</td>
67
+ <td align="center"><a href="https://github.com/devsapp/start-hapi" >Hapi</a></td>
68
+ <td align="center">Web2py</td>
69
+ <td align="center"><a href="https://github.com/devsapp/start-metinfo" >Metinfo</a></td>
70
+ <td></td><td></td><td></td>
71
+ </tr>
72
+ <tr>
73
+ <td align="center">8</td>
74
+ <td align="center"><a href="https://github.com/devsapp/start-expresscart">Expresscart</a></td>
75
+ <td align="center"><a href="https://github.com/devsapp/start-pyramid" >Pyramid</a></td>
76
+ <td align="center"><a href="https://github.com/devsapp/start-whatsns" >Whatsns</a></td><td></td><td></td><td></td>
77
+ </tr>
78
+ <tr>
79
+ <td align="center">9</td>
80
+ <td align="center"></td>
81
+ <td align="center"></td>
82
+ <td align="center"><a href="https://github.com/devsapp/start-typecho" >Typecho</a></td><td></td><td></td><td></td>
83
+ </tr>
84
+ </table>
85
+
86
+ ## 静态网站应用案例
87
+
88
+ 静态网站案例:https://github.com/devsapp/website-example
89
+ - 普通静态资源应用: `s init devsapp/website-example:website-base`
90
+ - react应用 `s init devsapp/website-example:website-react`
91
+ - vue应用 `s init devsapp/website-example:website-vue`
92
+ - hexo应用 `s init devsapp/website-example:website-hexo`
93
+ - docusaurus应用 `s init devsapp/website-example:website-docusaurus`
94
+ - vuepress应用 `s init devsapp/website-example:website-vuepress`
95
+
96
+ ## 开源框架应用案例
97
+ - Midway FaaS:https://github.com/devsapp/midway-hook-example
98
+ - react模板: `s init devsapp/midway-hook-example:midway-hook-react`
99
+ - vue模板 `s init devsapp/midway-hook-example:midway-hook-vue`
100
+ - Malagu:https://github.com/devsapp/start-s-malagu
101
+
102
+ ## 场景合集
103
+
104
+ ### Blog集合
105
+ - Zblog: https://github.com/devsapp/start-zblog `s init devsapp/start-zblog`
106
+ - Wordpress: https://github.com/devsapp/start-wordpress `s init devsapp/start-wordpress`
107
+ - Hexo: https://github.com/devsapp/start-hexo `s init devsapp/start-hexo`
108
+ - Vuepress: https://github.com/devsapp/website-example `s init devsapp/website-example:website-vuepress`
109
+ - Django Blog: https://github.com/devsapp/django-blog `s init devsapp/django-zblog`
110
+ - Typecho: https://github.com/devsapp/start-typecho `s init devsapp/start-typecho`
111
+
112
+ ### 企业官网
113
+ - Metinfo: https://github.com/devsapp/start-metinfo `s init devsapp/start-metinfo`
114
+
115
+ ### 社区问答
116
+ - Whatsns: https://github.com/devsapp/start-whatsns `s init devsapp/start-whatsns`
117
+ - Discuz: https://github.com/devsapp/start-discuz `s init devsapp/start-discuz`
118
+
119
+ ### 电子商务
120
+ - Echsop: https://github.com/devsapp/start-ecshop `s init devsapp/start-ecshop`
121
+ - Expresscart: https://github.com/devsapp/start-expresscart `s init devsapp/start-expresscart`
122
+
123
+ ### 其他
124
+ - 该项目模板是一个基于 puppeteer 的截图 Web 应用:
125
+ - https://github.com/devsapp/puppeteer-app `s init devsapp/puppeteer-app`
126
+ - https://github.com/devsapp/start-puppeteer `s init devsapp/start-puppeteer`
127
+ - 一款基于人工智能的目标检测应用: https://github.com/devsapp/image-prediction-app `s init devsapp/image-prediction-app`
128
+ - 一款基于Node.JS的网页TodoList应用: https://github.com/devsapp/todolist-app `s init devsapp/todolist-app`
129
+ - 基于函数计算 FC + FFmpeg 实现 Serverless 架构的弹性高可用的高度自定义音视频处理主题: https://github.com/devsapp/ffmpeg-app `s init devsapp/ffmpeg-app`
130
+ - 对直播视频流截图的应用: https://github.com/devsapp/start-rtmp-snapshot `s init start-rtmp-snapshot`
131
+ - 一个对浏览器全景录制: https://github.com/devsapp/start-headless-ffmpeg `s init start-headless-ffmpeg`
132
+ - 一个word转pdf的应用: https://github.com/devsapp/start-word2pdf `s init start-word2pdf`
133
+ - 一个pdf转图片的应用: https://github.com/devsapp/start-pdf2img `s init start-pdf2img`
134
+ - 在Serverless架构玩转pyTorch: https://github.com/devsapp/start-pytorch `s init start-pytorch`
135
+ - 在Serverless架构玩转Tensorflow: https://github.com/devsapp/start-tensorflow `s init start-tensorflow`
136
+ - Serverless架构的OCR工具: https://github.com/devsapp/start-ocr `s init start-ocr`
137
+
138
+
139
+ ## 静态网站应用案例
140
+
141
+ 静态网站案例:https://github.com/devsapp/website-example
142
+ - 普通静态资源应用: `s init devsapp/website-example:website-base`
143
+ - react应用 `s init devsapp/website-example:website-react`
144
+ - vue应用 `s init devsapp/website-example:website-vue`
145
+ - hexo应用 `s init devsapp/website-example:website-hexo`
146
+ - docusaurus应用 `s init devsapp/website-example:website-docusaurus`
147
+ - vuepress应用 `s init devsapp/website-example:website-vuepress`
148
+
149
+ ## Alinode
150
+ 可观测性:
151
+ - Insight: https://github.com/devsapp/alinode-faas-insight
152
+ - Runtime Http: https://github.com/devsapp/alinode-runtime-http
153
+ - FaaS Logs: https://github.com/devsapp/alinode-faas-sls-log
154
+ - Runtime Deploy: https://github.com/devsapp/alinode-runtime-deploy
155
+
156
+ ## 开源框架应用案例
157
+ - Midway FaaS:https://github.com/devsapp/midway-hook-example
158
+ - react模板: `s init devsapp/midway-hook-example:midway-hook-react`
159
+ - vue模板 `s init devsapp/midway-hook-example:midway-hook-vue`
160
+ - Malagu:https://github.com/devsapp/start-s-malagu
161
+
162
+ ## 场景合集
163
+
164
+ ### Blog集合
165
+ - Zblog: https://github.com/devsapp/start-zblog `s init devsapp/start-zblog`
166
+ - Wordpress: https://github.com/devsapp/start-wordpress `s init devsapp/start-wordpress`
167
+ - Hexo: https://github.com/devsapp/start-hexo `s init devsapp/start-hexo`
168
+ - Vuepress: https://github.com/devsapp/website-example `s init devsapp/website-example:website-vuepress`
169
+ - Django Blog: https://github.com/devsapp/django-blog `s init devsapp/django-zblog`
170
+ - Typecho: https://github.com/devsapp/start-typecho `s init devsapp/start-typecho`
171
+
172
+ ### 企业官网
173
+ - Metinfo: https://github.com/devsapp/start-metinfo `s init devsapp/start-metinfo`
174
+
175
+ ### 社区问答
176
+ - Whatsns: https://github.com/devsapp/start-whatsns `s init devsapp/start-whatsns`
177
+ - Discuz: https://github.com/devsapp/start-discuz `s init devsapp/start-discuz`
178
+
179
+ ### 电子商务
180
+ - Echsop: https://github.com/devsapp/start-ecshop `s init devsapp/start-ecshop`
181
+ - Expresscart: https://github.com/devsapp/start-expresscart `s init devsapp/start-expresscart`
182
+
183
+ ### 其他
184
+ - 该项目模板是一个基于 puppeteer 的截图 Web 应用:
185
+ - https://github.com/devsapp/puppeteer-app `s init devsapp/puppeteer-app`
186
+ - https://github.com/devsapp/start-puppeteer `s init devsapp/start-puppeteer`
187
+ - 一款基于人工智能的目标检测应用: https://github.com/devsapp/image-prediction-app `s init devsapp/image-prediction-app`
188
+ - 一款基于Node.JS的网页TodoList应用: https://github.com/devsapp/todolist-app `s init devsapp/todolist-app`
189
+ - 基于函数计算 FC + FFmpeg 实现 Serverless 架构的弹性高可用的高度自定义音视频处理主题: https://github.com/devsapp/ffmpeg-app `s init devsapp/ffmpeg-app`
190
+ - 对直播视频流截图的应用: https://github.com/devsapp/start-rtmp-snapshot `s init start-rtmp-snapshot`
191
+ - 一个对浏览器全景录制: https://github.com/devsapp/start-headless-ffmpeg `s init start-headless-ffmpeg`
192
+ - 一个word转pdf的应用: https://github.com/devsapp/start-word2pdf `s init start-word2pdf`
193
+ - 一个pdf转图片的应用: https://github.com/devsapp/start-pdf2img `s init start-pdf2img`
194
+ - 在Serverless架构玩转pyTorch: https://github.com/devsapp/start-pytorch `s init start-pytorch`
195
+ - 在Serverless架构玩转Tensorflow: https://github.com/devsapp/start-tensorflow `s init start-tensorflow`
196
+ - Serverless架构的OCR工具: https://github.com/devsapp/start-ocr `s init start-ocr`
197
+
198
+
199
+ # 组件集合
200
+
201
+ ## 基础组件
202
+
203
+ - 阿里云
204
+ - 函数计算(FC):
205
+ - Yaml描述:https://github.com/devsapp/fc
206
+ - 命令行交互:https://github.com/devsapp/fc-api (可以在无Yaml模式下直接进行使用)
207
+ - Serverless工作流(FNF):https://github.com/devsapp/fnf
208
+ - 腾讯云
209
+ - 云函数(SCF):https://github.com/devscomp/scf
210
+ - AWS
211
+ - Lambda:https://github.com/devscomp/lambda
212
+ - 百度云
213
+ - 函数计算(CFC):https://github.com/xinwuyun/cfc
214
+ - 华为云
215
+ - 函数工作流(FG):https://github.com/xinwuyun/fg
216
+
217
+
218
+
219
+
220
+ ## 上层组件
221
+
222
+ <table>
223
+ <tr>
224
+ <th>No.</th>
225
+ <th>:fire:Nodejs</th>
226
+ <th>Python</th>
227
+ <th>PHP</th>
228
+ <th>Go</th>
229
+ <th>Java</th>
230
+ <th>Others</th>
231
+ </tr>
232
+ <tr>
233
+ <td align="center">1</td>
234
+ <td align="center">:fire:<a href="https://github.com/devsapp/express">Express</a></td>
235
+ <td align="center">:fire::fire:<a href="https://github.com/devsapp/flask">Flask</a></td>
236
+ <td align="center"><a href="https://github.com/devsapp/thinkphp">Think PHP</a></td>
237
+ <td align="center">BeeGo</td>
238
+ <td align="center">Tomcat/Jetty</td>
239
+ <td align="center">Gatsby</td>
240
+ </tr>
241
+ <tr>
242
+ <td align="center">2</td>
243
+ <td align="center"><a href="https://github.com/devsapp/egg">Egg</a></td>
244
+ <td align="center"><a href="https://github.com/devsapp/tornado">Tornado</a></td>
245
+ <td align="center"><a href="https://github.com/devsapp/laravel">laravel</a></td>
246
+ <td align="center">Gin</td>
247
+ <td align="center">Spring Boot</td>
248
+ <td align="center">Hugo</td>
249
+ </tr>
250
+ <tr>
251
+ <td align="center">3</td>
252
+ <td align="center"><a href="https://github.com/devsapp/next">Nextjs</a></td>
253
+ <td align="center"><a href="https://github.com/devsapp/bottle">Bottle</a></td>
254
+ <td align="center"><a href="https://github.com/devsapp/discuz">Discuz</a></td><td></td><td align="center">Quarkus</td>
255
+ <td align="center">:fire::fire:<a href="https://github.com/devsapp/midway-hook">Midway FaaS</a></td>
256
+ </tr>
257
+ <tr>
258
+ <td align="center">4</td>
259
+ <td align="center"><a href="https://github.com/devsapp/nuxt">Nuxtjs</a></td>
260
+ <td align="center"><a href="https://github.com/devsapp/webpy">Web.py</a></td>
261
+ <td align="center"> :fire::fire::fire: <a href="https://github.com/devsapp/wordpress" >WordPress</a></td><td></td><td></td>
262
+ <td align="center">:fire:<a href="https://github.com/devsapp/s-malagu">Malagu</a></td>
263
+ </tr>
264
+ <tr>
265
+ <td align="center">5</td>
266
+ <td align="center"> :fire::fire::fire: <a href="https://github.com/devsapp/hexo" >Hexo</a></td>
267
+ <td align="center"><a href="https://github.com/devsapp/django" >Django</a></td>
268
+ <td align="center"> :fire::fire::fire: <a href="https://github.com/devsapp/zblog" >Zblog</a></td><td></td><td></td>
269
+ <td align="center">:fire::fire::fire:<a href="https://github.com/devsapp/website">Website</a></td>
270
+ </tr>
271
+ <tr>
272
+ <td align="center">6</td>
273
+ <td align="center"><a href="https://github.com/devsapp/koa" >Koa</a></td>
274
+ <td align="center">FastAPI</td>
275
+ <td align="center"><a href="https://github.com/devsapp/ecshop" >Ecshop</a></td><td></td><td></td><td></td>
276
+ </tr>
277
+ <tr>
278
+ <td align="center">7</td>
279
+ <td align="center"><a href="https://github.com/devsapp/hapi" >Hapi</a></td>
280
+ <td align="center">Web2py</td>
281
+ <td align="center"><a href="https://github.com/devsapp/metinfo" >Metinfo</a></td>
282
+ <td></td><td></td><td></td>
283
+ </tr>
284
+ <tr>
285
+ <td align="center">8</td>
286
+ <td align="center"></td>
287
+ <td align="center"><a href="https://github.com/devsapp/pyramid" >Pyramid</a></td>
288
+ <td align="center"><a href="https://github.com/devsapp/whatsns" >Whatsns</a></td><td></td><td></td><td></td>
289
+ </tr>
290
+ <tr>
291
+ <td align="center">9</td>
292
+ <td align="center"></td>
293
+ <td align="center"></td>
294
+ <td align="center"><a href="https://github.com/devsapp/typecho" >Typecho</a></td><td></td><td></td><td></td>
295
+ </tr>
296
+ </table>
@@ -0,0 +1,200 @@
1
+ # 与 CI/CD 平台/工具集成
2
+
3
+ - [与 Github Action 的集成](#与-github-action-的集成)
4
+ - [与 Gitee Go 的集成](#与-gitee-go-的集成)
5
+ - [与 Jenkins 的集成](#与-jenkins-的集成)
6
+ - [注意事项](#注意事项)
7
+
8
+ ## 与 Github Action 的集成
9
+
10
+ 在 Github Action 的 Yaml 文件中,可以增加 Serverless Devs 的相关下载、配置以及命令执行相关能力。
11
+
12
+ 例如,在仓库中可以创建该文件`.github/workflows/publish.yml`,文件内容:
13
+
14
+ ```yaml
15
+ name: Serverless Devs Project CI/CD
16
+
17
+ on:
18
+ push:
19
+ branches: [ master ]
20
+
21
+ jobs:
22
+ serverless-devs-cd:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - uses: actions/setup-node@v2
27
+ with:
28
+ node-version: 12
29
+ registry-url: https://registry.npmjs.org/
30
+ - run: npm install
31
+ - run: npm install -g @serverless-devs/s
32
+ - run: s config add --AccountID ${{secrets.AccountID}} --AccessKeyID ${{secrets.AccessKeyID}} --AccessKeySecret ${{secrets.AccessKeySecret}} -a default
33
+ - run: s deploy
34
+ ```
35
+
36
+ 主要包括几个部分的内容:
37
+ - `run: npm install -g @serverless-devs/s`:
38
+ 通过NPM安装最新版本的 Serverless Devs 开发者工具;
39
+ - `run: s config add --AccountID ${{secrets.AccountID}} --AccessKeyID ${{secrets.AccessKeyID}} --AccessKeySecret ${{secrets.AccessKeySecret}} -a default`
40
+ 通过`config`命令进行密钥等信息的配置;
41
+ - `run: s deploy`
42
+ 执行某些命令,例如通过`deploy`进行项目的部署,或者`build`等命令进行构建等;
43
+
44
+ 关于密钥的配置:密钥信息的获取是通过`${{secrets.*}}`进行获取的,所以此时,需要将所需要的密钥和对应的`Key`配置到 Github Secrets 中,例如在上面的案例中,需要`AccountID`,`AccessKeyID`,`AccessKeySecret`等三个密钥的 Key ,我们就可以配置相关的内容:
45
+
46
+ 1. 将密钥信息配置到Github Secrets中
47
+ ![](https://user-images.githubusercontent.com/21079031/120761131-71f28080-c547-11eb-9bb8-e08dafabb4ee.png)
48
+
49
+ 2. 我们创建多对密钥信息:
50
+ ![](https://user-images.githubusercontent.com/21079031/120761249-93ec0300-c547-11eb-9c0d-904fb85b4201.png)
51
+ 例如,我此处配置了三对密钥:
52
+ ![](https://user-images.githubusercontent.com/21079031/120761347-ae25e100-c547-11eb-9bcd-4fc742671bc5.png)
53
+
54
+ > 关于密钥配置的部分注意内容,可以参考文末的[注意事项](#注意事项)
55
+
56
+ ## 与 Gitee Go 的集成
57
+
58
+ 在开启 Gitee Go 的服务之后,在流水线的 Yaml 文件中,可以增加 Serverless Devs 的相关下载、配置以及命令执行相关能力。
59
+
60
+ 例如,在仓库中可以创建该文件`.github/workflows/publish.yml`,文件内容:
61
+
62
+ ```yaml
63
+ name: serverless-devs
64
+ displayName: 'Serverless Devs Project CI/CD'
65
+ triggers: # 流水线触发器配置
66
+ push: # 设置 master 分支 在产生代码 push 时精确触发(PRECISE)构建
67
+ - matchType: PRECISE
68
+ branch: master
69
+ commitMessage: '' # 通过匹配当前提交的 CommitMessage 决定是否执行流水线
70
+ stages: # 构建阶段配置
71
+ - stage: # 定义一个 ID 标识为 deploy-stage ,名为「 Deploy Stage 」的阶段
72
+ name: deploy-stage
73
+ displayName: 'Deploy Stage'
74
+ failFast: false # 允许快速失败,即当 Stage 中有任务失败时,直接结束整个 Stage
75
+
76
+ steps: # 构建步骤配置
77
+ - step: npmbuild@1 # 采用 npm 编译环境
78
+ name: deploy-step # 定义一个 ID 标识为 deploy-step ,名为「 Deploy Step 」的阶段
79
+ displayName: 'Deploy Step'
80
+ inputs: # 构建输入参数设定
81
+ nodeVersion: 14.15 # 指定 node 环境版本为 14.15
82
+ goals: | # 安装依赖,配置相关主题、部署参数并发布部署
83
+ node -v
84
+ npm -v
85
+ npm install -g @serverless-devs/s
86
+ s config add --AccountID $ACCOUNTID --AccessKeyID $ACCESSKEYID --AccessKeySecret $ACCESSKEYSECRET -a default
87
+ s deploy
88
+ ```
89
+
90
+ 主要包括几个部分的内容:
91
+ - `npm install -g @serverless-devs/s`:
92
+ 通过NPM安装最新版本的 Serverless Devs 开发者工具;
93
+ - `s config add --AccountID $ACCOUNTID --AccessKeyID $ACCESSKEYID --AccessKeySecret $ACCESSKEYSECRET -a default`
94
+ 通过`config`命令进行密钥等信息的配置;
95
+ - `s deploy`
96
+ 执行某些命令,例如通过`deploy`进行项目的部署,或者`build`等命令进行构建等;
97
+
98
+ 关于密钥的配置:密钥信息的获取是通过`$*`进行获取的,所以此时,需要将所需要的密钥和对应的`Key`配置到 Gitee 的环境变量管理即可,例如在上面的案例中,需要`ACCOUNTID`,`ACCESSKEYID`,`ACCESSKEYSECRET`等三个密钥的 Key ,我们就可以配置相关的内容:
99
+
100
+ 1. 找到 Gitee 的环境变量管理
101
+ ![](https://user-images.githubusercontent.com/21079031/124716639-e5b4ee00-df36-11eb-9dc8-cf2d8eb30e51.png)
102
+
103
+ 2. 我们创建多对密钥信息:
104
+ ![](https://user-images.githubusercontent.com/21079031/124719394-aa67ee80-df39-11eb-84ad-944ccf0486ba.png)
105
+ 例如,我此处配置了三对密钥:
106
+ ![](https://user-images.githubusercontent.com/21079031/124719496-c9ff1700-df39-11eb-8ef6-4ccae28caefc.png)
107
+
108
+ > 关于密钥配置的部分注意内容,可以参考文末的[注意事项](#注意事项)
109
+
110
+
111
+ ## 与 Jenkins 的集成
112
+
113
+ 在准备将 Serverless Devs 集成到 Jenkins 之前,需要先基于 [Jenkins 官网](https://www.jenkins.io/zh/doc/pipeline/tour/getting-started/) 安装并运行 Jenkins。
114
+
115
+ 本地启动 Jenkins 后,通过浏览器进入链接 `http://localhost:8080` 配置完成基础设置后,需要新增 Credentials 设置,如下图所示:
116
+
117
+ ![](https://img.alicdn.com/imgextra/i2/O1CN01tSgoo71Ne62AMGxqh_!!6000000001594-2-tps-3582-1048.png)
118
+
119
+ 此时可以根据需要,增加密钥信息,以阿里云为例,新增三个全局凭据:
120
+
121
+ ```
122
+ jenkins-alicloud-account-id : 阿里云 accountId
123
+
124
+ jenkins-alicloud-access-key-id : 阿里云 accessKeyId
125
+
126
+ jenkins-alicloud-access-key-secret : 阿里云 accessKeySecret
127
+ ```
128
+
129
+ > 新增 Credentials 的教程可以参考[这里](https://www.jenkins.io/zh/doc/book/using/using-credentials/)。
130
+
131
+ 此时,可以对自身的 Serverless Devs 项目进行完善:
132
+
133
+ - 创建文件`Jenkinsfile`
134
+ ```
135
+ pipeline {
136
+ agent {
137
+ docker {
138
+ image 'maven:3.3-jdk-8'
139
+ }
140
+ }
141
+
142
+ environment {
143
+ ALICLOUD_ACCESS = 'default'
144
+ ALICLOUD_ACCOUNT_ID = credentials('jenkins-alicloud-account-id')
145
+ ALICLOUD_ACCESS_KEY_ID = credentials('jenkins-alicloud-access-key-id')
146
+ ALICLOUD_ACCESS_KEY_SECRET = credentials('jenkins-alicloud-access-key-secret')
147
+ }
148
+
149
+ stages {
150
+ stage('Setup') {
151
+ steps {
152
+ sh 'scripts/setup.sh'
153
+ }
154
+ }
155
+ }
156
+ }
157
+ ```
158
+ 主要的内容包括两个部分:
159
+ - environment 部分,主要是根据上面步骤配置的密钥信息,进行密钥的处理;
160
+ - stages 部分,这里面会有一个部分是`sh 'scripts/setup.sh'`,即运行`scripts/setup.sh`文件,进行相关内容的准备和配置;
161
+ - 准备`scripts/setup.sh`文件,只需要在项目下,创建该文件即可:
162
+ ```shell script
163
+ #!/usr/bin/env bash
164
+
165
+ echo $(pwd)
166
+ curl -o- -L http://cli.so/install.sh | bash
167
+
168
+ source ~/.bashrc
169
+
170
+ echo $ALICLOUD_ACCOUNT_ID
171
+ s config add --AccountID $ALICLOUD_ACCOUNT_ID --AccessKeyID $ALICLOUD_ACCESS_KEY_ID --AccessKeySecret $ALICLOUD_ACCESS_KEY_SECRET -a $ALICLOUD_ACCESS
172
+
173
+ (cd code && mvn package && echo $(pwd))
174
+
175
+ s deploy -y --use-local --access $ALICLOUD_ACCESS
176
+ ```
177
+ 在该文件中,主要包括了几个部分:
178
+ - `curl -o- -L http://cli.so/install.sh | bash`
179
+ 下载并安装 Serverless Devs 开发者工具
180
+ - `s config add --AccountID $ALICLOUD_ACCOUNT_ID --AccessKeyID $ALICLOUD_ACCESS_KEY_ID --AccessKeySecret $ALICLOUD_ACCESS_KEY_SECRET -a $ALICLOUD_ACCESS`
181
+ 配置密钥信息等内容
182
+ - `s deploy -y --use-local --access $ALICLOUD_ACCESS`
183
+ 执行某些命令,例如通过`deploy`进行项目的部署,或者`build`等命令进行构建等;
184
+
185
+
186
+ 完成密钥配置之后,可以创建一个 Jenkins 流水线,该流水线的源是目标 github 地址。接下来,就可以开始运行 Jenkins 流水线,运行结束后,就可以得到相关的内容结果。
187
+
188
+ > 关于密钥配置的部分注意内容,可以参考文末的[注意事项](#注意事项)
189
+
190
+
191
+ ## 注意事项
192
+
193
+ - 在配置密钥的时候,使用了`s config add`命令,此时在最后有一个参数是`-a default`,代表的是给该密钥一个叫`default`的别名,这个别名要和项目所设定的使用密钥保持一致,例如在`s.yaml`中的`access`字段;
194
+ - 如果在当前应用在,涉及到了配置部署到不同的平台或者账号下,可能会涉及到配置多个密钥信息,此时需要给不同的密钥不同的别名,并且在`s.yaml`中进行使用;
195
+ - 如果想要配置更为灵活的密钥信息,可以考虑通过`-il`和`-kl`参数获取,例如同时配置两对密钥,并且使用自定义 Key :
196
+ ```yaml
197
+ s config add -kl tempToken1,tempToken2 -il tempValue1,tempValue2 -a website_access
198
+ s config add -kl tempToken3,tempToken4 -il tempValue3,tempValue4 -a fc_access
199
+ ```
200
+