-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Give an alert to Rails to Go migration (#632)
* Add a important info to readme * Update readme to add a warning info for Rails to Gin migrate
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 迁移到 Gin 版本 | ||
|
||
首先我们假设,你已经有一个 Rails 版本的 CSGHub Portal 部署好了。 | ||
|
||
## 拉取最新的仓库,默认使用 Gin 版本 | ||
|
||
```bash | ||
git fetch origin | ||
git reset --hard origin/main | ||
``` | ||
|
||
通过这个代码,你可以把本地的 main 分支重置为远程的 main 分支,同时你也会拉取一个名为 'rails-main' 的分支,这个分支中包含了旧的 Rails 版本的代码。 | ||
|
||
## 部署你的 Gin server | ||
请参考[Setup](setup_en.md) 来部署你的 Gin 服务器。是的,默认情况下 Gin 会使用 8090 端口。 | ||
|
||
### 数据库设置 | ||
你可以通过环境变量 CSGHUB_PORTAL_DATABASE_DSN 来设置数据库连接。你可以使用和 Rails 版本相同的数据库,因为我们已经完成了兼容性考虑。 | ||
|
||
需要注意的是默认的数据库URL是:“postgresql://postgres:postgres@localhost:5432/starhub_portal?”sslmode=disable"这可能与您的Rails服务器有不同的数据库名称,您可能需要更新它在本地运行。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Migrate to Gin | ||
|
||
Let's assume that you already have a Rails version Portal deployed before. | ||
|
||
## Pull the latest repo with Gin version as default | ||
|
||
```bash | ||
git fetch origin | ||
git reset --hard origin/main | ||
``` | ||
|
||
By doing this, you will use the remote latest main branch to overwrite your local main branch. You also fetch the 'rails-main' branch to local in which you can see the old Rails version code. | ||
|
||
## Deploy your Gin server | ||
Please refer to [Setup](setup_en.md) to deploy your Gin server. Yes, you should deloy a new server by default Gin will use 8090 port. | ||
|
||
### DB config | ||
You can setup the DB url by ENV variable: CSGHUB_PORTAL_DATABASE_DSN. And you can use the same database used by your Rails server, as we have completed the compatibility considerations. | ||
|
||
One thing to note is the default database URL which is: "postgresql://postgres:postgres@localhost:5432/starhub_portal?sslmode=disable" which may have a different database name to your Rails server, you may need to update it which running it locally. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters