mirror of
https://github.com/usememos/memos.git
synced 2024-12-01 06:34:35 +03:00
fix: version getter
This commit is contained in:
parent
5731fb8912
commit
0b50122aac
@ -6,7 +6,7 @@ on:
|
||||
- "main"
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
build-and-push-dev-image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -7,7 +7,7 @@ on:
|
||||
- "release/v*.*.*"
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
build-and-push-release-image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -30,7 +30,7 @@
|
||||
## ⚓️ Deploy with Docker
|
||||
|
||||
```docker
|
||||
docker run --name memos --publish 8080:8080 --volume ~/.memos/:/var/opt/memos -e mode=prod neosmemo/memos:0.0.1
|
||||
docker run --name memos --publish 5230:8080 --volume ~/.memos/:/var/opt/memos -e mode=prod neosmemo/memos:0.0.1
|
||||
```
|
||||
|
||||
If the `~/.memos/` does not have a `memos_prod.db` file, then `memos` will auto generate it.
|
||||
@ -45,7 +45,7 @@ Memos is built with a curated tech stack. It is optimized for developer experien
|
||||
|
||||
### Tech Stack
|
||||
|
||||
<img alt="tech stack" src="https://raw.githubusercontent.com/justmemos/memos/main/resources/tech-stack.png" width="320" />
|
||||
<img alt="tech stack" src="https://raw.githubusercontent.com/justmemos/memos/main/resources/tech-stack.png" width="360" />
|
||||
|
||||
### Prerequisites
|
||||
|
||||
|
@ -40,20 +40,6 @@ func checkDSN(dataDir string) (string, error) {
|
||||
return dataDir, nil
|
||||
}
|
||||
|
||||
func getSystemVersion() string {
|
||||
absPath, err := filepath.Abs("./VERSION")
|
||||
if err != nil {
|
||||
return "0.0.0"
|
||||
}
|
||||
|
||||
data, err := os.ReadFile(absPath)
|
||||
if err != nil {
|
||||
return "0.0.0"
|
||||
}
|
||||
|
||||
return string(data)
|
||||
}
|
||||
|
||||
// GetDevProfile will return a profile for dev.
|
||||
func GetProfile() *Profile {
|
||||
mode := os.Getenv("mode")
|
||||
@ -79,12 +65,10 @@ func GetProfile() *Profile {
|
||||
|
||||
dsn := fmt.Sprintf("%s/memos_%s.db", dataDir, mode)
|
||||
|
||||
version := getSystemVersion()
|
||||
|
||||
return &Profile{
|
||||
Mode: mode,
|
||||
Port: port,
|
||||
DSN: dsn,
|
||||
Version: version,
|
||||
Version: Version,
|
||||
}
|
||||
}
|
||||
|
4
common/version.go
Normal file
4
common/version.go
Normal file
@ -0,0 +1,4 @@
|
||||
package common
|
||||
|
||||
// Version is the service current released version.
|
||||
var Version = "0.0.1"
|
Loading…
Reference in New Issue
Block a user