Skip to content

Commit

Permalink
fix: resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
mutezebra committed Nov 4, 2024
2 parents 8a97794 + 4ec522d commit 2fa9663
Show file tree
Hide file tree
Showing 217 changed files with 16,229 additions and 9,852 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy to Cloud Server

on:
workflow_dispatch:
inputs:
service:
description: "Select the service to deploy"
required: true
type: choice
options:
- api
- user
- classroom
- course
- launch_screen
- paper
- academic

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Check out the code
uses: actions/checkout@v4

- name: Log in to Alibaba Cloud Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.ALIYUN_DOCKER_REGISTRY }}
username: ${{ secrets.ALIYUN_DOCKER_USER }}
password: ${{ secrets.ALIYUN_DOCKER_PASSWORD }}

- name: Build and Push Docker Image
run: |
cd $GITHUB_WORKSPACE && bash ./hack/image-build-and-push.sh ${{ github.event.inputs.service }}
- name: SSH and deploy on server
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
cd ~/hack
bash docker-run.sh ${{ github.event.inputs.service }}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,10 @@ dumped_hertz_remote_config.json
/config/sql
/docker/data/*
/config/config.yaml
/config/config.yaml.bak

coverage.txt
coverage.txt
ca-key
*.jks

/log
6 changes: 6 additions & 0 deletions .hz
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Code generated by hz. DO NOT EDIT.

hz version: v0.9.1
handlerDir: ./api/handler
modelDir: ./api/model
routerDir: ./api/router
74 changes: 74 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 这个文件列出了本项目的主要维护者,以及所负责的模块。
#
# 注释格式: 加入工作室年份-维护者姓名 <电子邮件地址> (维护者用户名)
# 文本格式: 模块路径 @维护者用户名1 @维护者用户名2 ...

## Root
# 2023-李梓玄 <[email protected]> (@jiuxia211)
# 2022-林黄骁 <[email protected]> (@ozline)

* @west2-online/fzuhelper @jiuxia211 @ozline


## CI
# 2024-朱胤帆 <[email protected]> (@SchwarzSail)

/.github @SchwarzSail


## pkg
# 2024-马奔 <[email protected]> (@mutezebra)
# 2022-林黄骁 <[email protected]> (@ozline)

/pkg @mutezebra @ozline


# ======== 以下为各模块的负责人 ========

## cmd/academic
# 2023-李梓玄 <[email protected]> (@jiuxia211)

/cmd/academic @jiuxia211
/internal/academic @jiuxia211


## cmd/course
# 2024-任宝硕 <[email protected]> (@renbaoshuo)

/cmd/course @renbaoshuo
/internal/course @renbaoshuo


## cmd/classroom
# 2024-朱胤帆 <[email protected]> (@SchwarzSail)

/cmd/classroom @SchwarzSail
/internal/classroom @SchwarzSail


## cmd/launch_screen
# 2024-肖垲 <[email protected]> (@FantasyRL)

/cmd/launch_screen @FantasyRL
/internal/launch_screen @FantasyRL


## cmd/paper
# 2024-庄仲华 <[email protected]> (@penqee)

/cmd/paper @penqee
/internal/paper @penqee


## cmd/user
# 2023-李梓玄 <[email protected]> (@jiuxia211)

/cmd/user @jiuxia211
/internal/user @jiuxia211


## cmd/exam
# 2024-马奔 <[email protected]> (@mutezebra)

/cmd/exam @mutezebra
/internal/exam @mutezebra
47 changes: 0 additions & 47 deletions MAINTAINERS

This file was deleted.

18 changes: 4 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ help:
@echo "Available targets:"
@echo " {service name} : Build a specific service (e.g., make api). use BUILD_ONLY=1 to avoid auto bootstrap."
@echo " Available service list: [${SERVICES}]"
@echo " local : Build all services."
@echo " env-up : Start the docker-compose environment."
@echo " env-down : Stop the docker-compose environment."
@echo " kitex-gen-% : Generate Kitex service code for a specific service (e.g., make kitex-gen-user)."
Expand Down Expand Up @@ -77,11 +76,10 @@ kitex-update-%:
kitex -module "${MODULE}" idl/$*.thrift

# 生成基于 Hertz 的脚手架
# TODO: 这个和 Kitex 的区别在于这个 update 实际上做了 gen 的工作,就直接这么用了
# TODO: 这个和 Kitex 的区别在于这个 update 实际上做了 gen 的工作,相关路径需要在 .hz 中修改
.PHONY: hertz-gen-api
hertz-gen-api:
cd ${API_PATH}; \
hz update -idl ${IDL_PATH}/api.thrift;
hz update -idl ${IDL_PATH}/api.thrift

# 单元测试
.PHONY: test
Expand Down Expand Up @@ -111,8 +109,7 @@ $(SERVICES):
else \
echo "$(PREFIX) Build $(service) target..."; \
mkdir -p output; \
cd $(CMD)/$(service) && bash build.sh; \
cd $(CMD)/$(service)/output && cp -r . $(OUTPUT_PATH)/$(service); \
bash $(DIR)/docker/script/build.sh $(service); \
echo "$(PREFIX) Build $(service) target completed"; \
fi
ifndef BUILD_ONLY
Expand All @@ -127,17 +124,10 @@ ifndef BUILD_ONLY
tmux select-layout -t "fzuhelper-$(service)" even-horizontal; \
fi
@echo "$(PREFIX) Running $(service) service in tmux..."
@tmux send-keys -t fzuhelper-$(service).0 'bash ./hack/entrypoint.sh $(service)' C-m
@tmux send-keys -t fzuhelper-$(service).0 'export SERVICE=$(service) && bash ./docker/script/entrypoint.sh' C-m
@tmux select-pane -t fzuhelper-$(service).1
endif

#在本地一键启动所有的服务
.PHONY: local
local:
@ for service in $(SERVICES); do \
make $$service; \
done

# 推送到镜像服务中,需要提前 docker login,否则会推送失败
# 不设置同时推送全部服务,这是一个非常危险的操作
.PHONY: push-%
Expand Down
51 changes: 29 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,34 @@ This project focuses on business implementation. To see how we interface with th
## Project structure

```bash
│ .golangci.yml # GolangCI configuration
│ .licenseignore
│ go.mod
│ go.sum
│ LICENSE
│ Makefile # some useful commands
│ README.md
├── cmd # microservices
├── config # for run-directly config and config-example
├── docker # docker build configuration
.
├── .golangci.yml # GolangCI configuration
├── .licenseignore
├── go.mod
├── go.sum
├── LICENSE
├── Makefile # some useful commands
├── README.md
├── api # gateway
├── cmd # microservices entry
├── config # configuration files and examples
├── docker # Docker build configuration
├── docs
├── hack # tools for automating development, build, and deployment tasks.
├── hack # tools for automating development, building, and deployment tasks
├── idl # interface definition
├── internal # microservices implementation
├── kitex_gen # kitex generated code
├── pkg
│ ├── client/ # client side implementations
│ ├── constants/ # store any consts
│ ├── errno/ # custom error
│ ├── logger/ # logging system
│ ├── middleware/ # common middleware
│ ├── tracer/ # for jaeger
│ └── utils/ # useful funcs
└── pkg
├── base/ # common base service
│ └── client/ # client for corresponding components (redis, mysql e.g.)
├── cache/ # cache service
├── db/ # database service
├── constants/ # store any consts
├── errno/ # custom error
├── eshook # elasticsearch hook
├── logger/ # logging system
├── tracer/ # for jaeger
└── utils/ # useful funcs
```

## Quick start and deploy
Expand All @@ -56,13 +62,14 @@ please visit: [deploy](docs/deploy.md)

## Architecture

<img src="/docs/img/architecture.svg">
<img src="./docs/img/architecture.svg">

## Contributors

<img src="/docs/img/logo(en).svg" width="400">
<img src="./docs/img/logo(en).svg" width="400">

If you are interested in joining the maintenance of fzuhelper-server, please contact us on our [official website](https://site.west2.online)

## License
`fzuhelper-server` is under the Apache 2.0 license. See the LICENSE file for details.

`fzuhelper-server` is licensed under the Apache 2.0 license. See the LICENSE file for details.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2fa9663

Please sign in to comment.