Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
anycodes committed Jun 4, 2021
0 parents commit 03f494d
Show file tree
Hide file tree
Showing 40 changed files with 8,085 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/registry-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: publish package to serverless-hub

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install requests
- name: NPM install
run: |
npm install --production
- name: Add publish file
run: |
wget https://serverless-registry.oss-cn-hangzhou.aliyuncs.com/publish-file/python3/hub-publish.py
ls
- name: Publish package
env:
publish_token: ${{ secrets.alibaba_registry_publish_token }}
run: |
ls
python hub-publish.py
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.s
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
printWidth: 150,
tabWidth: 2,
semi: true,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'always',
};
7 changes: 7 additions & 0 deletions .signore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.s
tsconfig.json
LICENSE
package-lok.json
.prettierrc.js
.gitignore
59 changes: 59 additions & 0 deletions Design-Documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Serverless Devs CI/CD解决方案

🍀 Serverless Devs CI/CD 主要是Serverless devs针对CI/CD场景的解决方案建设。这部分可能没有想象中的复杂,但是也不会非常简单。

目前的主要思路:


通过工具侧,为函数计算的CI/CD能力做一些铺垫,目前的想法,或者说整体思路是包括两个部分的

- 模板部分
- 行为部分


## 模板部分

模板部分是说,我们要针对主流的CI/CD平台,提供相对应的模板。例如Github Action,Gitee Go等。期待的使用方法是,用户在当前项目下:

```
s cli cicd -p/--platform github
```

即可在当前项目下创建一个.github/serverless-devs.yaml的模板文档,同时创建之后,给用户在控制台返回对应的最佳实践案例:

```
Github Action Template created successfully.
You can refer to the following documents for more operations:
- 如何通过Serverless Devs做CI: https://www.serverless-devs.com/blog/cicd/*****
- 如何通过Serverless Devs做CD: https://www.serverless-devs.com/blog/cicd/*****
- ***********相关文章和链接地址
```

其他平台操作行为等类似。这种模板行为其实更多来说是辅助用户做一些CI/CD的操作。

核心组成:
1. 模板
2. 案例


## 行为部分

这一部分是比较复杂的高阶操作。目前的想法是不是可以让用户直接在函数计算上做一些cicd的行为,例如:

```
s cli cicd -p/--platform fc
```

此时系统会帮助用户创建两个函数资源,一个是CI函数,一个是CD函数(有待讨论),并且返回一个触发地址(http触发器地址,可以配置到webhooks中),并且返回使用方法,例如:

```
Github Action Template created successfully.
Webhook Url: http://devsapp.net/**********
You can refer to the following documents for more operations:
- 如何通过Serverless Devs做CI: https://www.serverless-devs.com/blog/cicd/*****
- 如何通过Serverless Devs做CD: https://www.serverless-devs.com/blog/cicd/*****
- ***********相关文章和链接地址
```

用户的使用方法很简单,只需要在当前项目下,增加一个CI/CD的模版即可(例如我们指定是.s/ci.yaml, .s/cd.yaml)

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Serverless Devs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 03f494d

Please sign in to comment.