Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 73 additions & 73 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,80 +220,80 @@ jobs:
```
reactions: eyes, rocket

deploy-tend-pr:
needs: [build]
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Extract env from pr body
id: pr-env
uses: 36node/action-pr-env@v1.0.0
with:
text: '${{ github.event.pull_request.body }}'
# deploy-tend-pr:
# needs: [build]
# if: github.event_name == 'pull_request'
# runs-on: ubuntu-latest
# steps:
# - name: Extract env from pr body
# id: pr-env
# uses: 36node/action-pr-env@v1.0.0
# with:
# text: '${{ github.event.pull_request.body }}'

- name: Deploy
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
port: ${{ secrets.DEPLOY_PORT }}
script: |
cd ${{ env.CLUSTER_DIR }}
source .envrc
EXPORT_COMMANDS=$(echo '${{ toJson(steps.pr-env.outputs.env) }}' | jq -r 'to_entries | .[] | "export \(.key)=\(.value)"')
echo "$EXPORT_COMMANDS"
eval "$EXPORT_COMMANDS"
tag=$(echo sha-${{ github.sha }} | cut -c1-11)
ansible-playbook ${{ env.TEND_PR_PLAYBOOK }} -e "${{ env.TAG_NAME }}=${tag} deploy=${{ env.DEPLOY }}"
# - name: Deploy
# uses: appleboy/ssh-action@v1.0.3
# with:
# host: ${{ secrets.DEPLOY_HOST }}
# username: ${{ secrets.DEPLOY_USERNAME }}
# key: ${{ secrets.DEPLOY_KEY }}
# port: ${{ secrets.DEPLOY_PORT }}
# script: |
# cd ${{ env.CLUSTER_DIR }}
# source .envrc
# EXPORT_COMMANDS=$(echo '${{ toJson(steps.pr-env.outputs.env) }}' | jq -r 'to_entries | .[] | "export \(.key)=\(.value)"')
# echo "$EXPORT_COMMANDS"
# eval "$EXPORT_COMMANDS"
# tag=$(echo sha-${{ github.sha }} | cut -c1-11)
# ansible-playbook ${{ env.TEND_PR_PLAYBOOK }} -e "${{ env.TAG_NAME }}=${tag} deploy=${{ env.DEPLOY }}"

- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Deployed to: https://${{ env.TEND_DOMAIN }}
reactions: eyes, rocket
# - name: Comment PR
# uses: thollander/actions-comment-pull-request@v2
# with:
# message: |
# Deployed to: https://${{ env.TEND_DOMAIN }}
# reactions: eyes, rocket

- name: Feishu Robot Nessage
run: |
curl -X POST -H "Content-Type: application/json" \
-d '
{
"msg_type": "post",
"content": {
"post": {
"zh_cn": {
"title": "请查阅: Auth PR ${{ github.event.pull_request.number }} 已发布/更新",
"content": [
[{
"tag": "a",
"text": "${{ github.event.pull_request.title }}\n",
"href": "${{ github.event.pull_request.html_url }}"
},{
"tag": "text",
"text": "Deploy to https://${{ env.TEND_DOMAIN }}\n"
}]
]
}
}
}
}' \
https://open.feishu.cn/open-apis/bot/v2/hook/${{ secrets.TEND_FEISHU_ROBOT_TOKEN }}
# - name: Feishu Robot Nessage
# run: |
# curl -X POST -H "Content-Type: application/json" \
# -d '
# {
# "msg_type": "post",
# "content": {
# "post": {
# "zh_cn": {
# "title": "请查阅: Auth PR ${{ github.event.pull_request.number }} 已发布/更新",
# "content": [
# [{
# "tag": "a",
# "text": "${{ github.event.pull_request.title }}\n",
# "href": "${{ github.event.pull_request.html_url }}"
# },{
# "tag": "text",
# "text": "Deploy to https://${{ env.TEND_DOMAIN }}\n"
# }]
# ]
# }
# }
# }
# }' \
# https://open.feishu.cn/open-apis/bot/v2/hook/${{ secrets.TEND_FEISHU_ROBOT_TOKEN }}

deploy-tend-uat:
needs: [build]
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Deploy
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
port: ${{ secrets.DEPLOY_PORT }}
script: |
cd ${{ env.CLUSTER_DIR }}
source .envrc
tag=$(echo sha-${{ github.sha }} | cut -c1-11)
ansible-playbook ${{ env.TEND_UAT_PLAYBOOK }} -e "${{ env.TAG_NAME }}=${tag}"
# deploy-tend-uat:
# needs: [build]
# if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
# runs-on: ubuntu-latest
# steps:
# - name: Deploy
# uses: appleboy/ssh-action@v1.0.3
# with:
# host: ${{ secrets.DEPLOY_HOST }}
# username: ${{ secrets.DEPLOY_USERNAME }}
# key: ${{ secrets.DEPLOY_KEY }}
# port: ${{ secrets.DEPLOY_PORT }}
# script: |
# cd ${{ env.CLUSTER_DIR }}
# source .envrc
# tag=$(echo sha-${{ github.sha }} | cut -c1-11)
# ansible-playbook ${{ env.TEND_UAT_PLAYBOOK }} -e "${{ env.TAG_NAME }}=${tag}"
14 changes: 13 additions & 1 deletion openapi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"hash": "324c3d644794265dacf38d5ef9aaa68188122ecf12539a23d2ddc7cb47659aed",
"hash": "189465f53d5bfb85ccd821705afe4c5373f0c5cd3ed83959ef196da6953a29be",
"openapi": "3.0.0",
"paths": {
"/hello": {
Expand Down Expand Up @@ -3477,6 +3477,10 @@
"CreateGroupDto": {
"type": "object",
"properties": {
"data": {
"type": "string",
"description": "额外数据"
},
"name": {
"type": "string",
"description": "名称"
Expand Down Expand Up @@ -3504,6 +3508,10 @@
"Group": {
"type": "object",
"properties": {
"data": {
"type": "string",
"description": "额外数据"
},
"name": {
"type": "string",
"description": "名称"
Expand Down Expand Up @@ -3554,6 +3562,10 @@
"UpdateGroupDto": {
"type": "object",
"properties": {
"data": {
"type": "string",
"description": "额外数据"
},
"name": {
"type": "string",
"description": "名称"
Expand Down
8 changes: 8 additions & 0 deletions src/group/entities/group.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ import { helper, MongoEntity } from 'src/mongo';

@Schema()
export class GroupDoc {
/**
* 额外数据
*/
@IsOptional()
@IsString()
@Prop()
data?: string;

/**
* 名称
*/
Expand Down