Skip to content

Commit

Permalink
feat 初步完成 gradle 构建发布
Browse files Browse the repository at this point in the history
  • Loading branch information
falling-ts committed Nov 10, 2024
1 parent 9613f2e commit 7893295
Show file tree
Hide file tree
Showing 26 changed files with 478 additions and 75 deletions.
4 changes: 4 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 前端环境

# 请求 HOST
VITE_APP_URL=http://localhost:8080
4 changes: 0 additions & 4 deletions .env.development

This file was deleted.

11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ node_modules/
# Environment files
.env
.env.test
.env.production
.env.prod
!.env.default
!.env.example
!.env.development
!.env.dev

envs/.env
envs/.env.test
envs/.env.production
envs/.env.prod
!envs/.env.default
!envs/.env.example
!envs/.env.development
!envs/.env.dev

# Logs and databases
*.log
Expand All @@ -52,3 +52,6 @@ ehthumbs_vista.db

# Symbol Files
static

.gradle/
build/
12 changes: 6 additions & 6 deletions .run/RunDev.run.xml → .run/Gower Run.run.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="RunDev" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="gower" />
<working_directory value="$PROJECT_DIR$" />
<configuration default="false" name="Gower Run" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="gower-work" />
<working_directory value="$PROJECT_DIR$/src/gower" />
<go_parameters value="-tags tmpl,static" />
<parameters value="run" />
<kind value="DIRECTORY" />
<kind value="PACKAGE" />
<package value="github.com/falling-ts/gower" />
<directory value="$PROJECT_DIR$" />
<directory value="$PROJECT_DIR$/src/gower" />
<filePath value="$PROJECT_DIR$/../gower-work|$PROJECT_DIR$/src/gower/main.go" />
<method v="2">
<option name="NpmBeforeRunTask" enabled="true">
<package-json value="$PROJECT_DIR$/package.json" />
<package-json value="$PROJECT_DIR$/src/gower/package.json" />
<command value="run" />
<scripts>
<script value="dev" />
Expand Down
2 changes: 2 additions & 0 deletions .ssh/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ $ go install -tags cli
#### 4.初始化环境

在根目录下,复制出 `.env.test``.env.production` 两个前端环境文件
在根目录下,复制出 `.env.test``.env.prod` 两个前端环境文件

`envs/` 目录下,复制出 `.env.test``.env.production` 两个后端环境文件
`envs/` 目录下,复制出 `.env.test``.env.prod` 两个后端环境文件

生成 APP 和 JWT 的密钥

Expand Down Expand Up @@ -228,7 +228,7 @@ type Hello struct {
}
```

> 注: 如果命令输出很多 Debug 内容,那是因为 envs/.env.development 的 APP_MODE 是开发模式, 修改为测试模式就可以了
> 注: 如果命令输出很多 Debug 内容,那是因为 envs/.env.dev 的 APP_MODE 是开发模式, 修改为测试模式就可以了
### 添加路由

Expand Down
6 changes: 3 additions & 3 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ $ go install -tags cli

#### 4. Initialize environment

* In the root directory, copy the two frontend environment files `.env.test` and `.env.production`.
* In the `envs/` directory, copy the two backend environment files `.env.test` and `.env.production`.
* In the root directory, copy the two frontend environment files `.env.test` and `.env.prod`.
* In the `envs/` directory, copy the two backend environment files `.env.test` and `.env.prod`.
* Generate the APP and JWT keys.

```shell
Expand Down Expand Up @@ -217,7 +217,7 @@ type Hello struct {
Name *string `gorm:"type:string;default:'';comment:Name"`
}
```
> Note: If the command outputs a lot of Debug content, it's because the APP\_MODE in envs/.env.development is in development mode. Change it to test mode to resolve.
> Note: If the command outputs a lot of Debug content, it's because the APP\_MODE in envs/.env.dev is in development mode. Change it to test mode to resolve.
* Add a route
`routes/web.go`
```go
Expand Down
4 changes: 2 additions & 2 deletions app/consoles/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ func create(project string) error {
}

func initEnv(dir string) error {
dev := filepath.Join(dir, ".env.development")
dev := filepath.Join(dir, ".env.dev")
test := filepath.Join(dir, ".env.test")
prod := filepath.Join(dir, ".env.production")
prod := filepath.Join(dir, ".env.prod")

err := copyFile(dev, test)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions app/consoles/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func execInit(arg string) error {
return err
}

err = util.SetEnv("envs/.env.development", "APP_KEY", key)
err = util.SetEnv("envs/.env.dev", "APP_KEY", key)
if err != nil {
return err
}
Expand All @@ -48,7 +48,7 @@ func execInit(arg string) error {
}
}

prod := "envs/.env.production"
prod := "envs/.env.prod"
if util.IsExist(prod) {
err = util.SetEnv(prod, "APP_KEY", key)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions app/consoles/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func execJwt(arg string) error {
if err != nil {
return err
}
err = util.SetEnv("envs/.env.development", "JWT_KEY", key)
err = util.SetEnv("envs/.env.dev", "JWT_KEY", key)
if err != nil {
return err
}
Expand All @@ -47,7 +47,7 @@ func execJwt(arg string) error {
}
}

prod := "envs/.env.production"
prod := "envs/.env.prod"
if util.IsExist(prod) {
err = util.SetEnv(prod, "JWT_KEY", key)
if err != nil {
Expand Down
Loading

0 comments on commit 7893295

Please sign in to comment.