mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: version getter
This commit is contained in:
@@ -6,7 +6,7 @@ on:
|
|||||||
- "main"
|
- "main"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
build-and-push-dev-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@@ -7,7 +7,7 @@ on:
|
|||||||
- "release/v*.*.*"
|
- "release/v*.*.*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
build-and-push-release-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
## ⚓️ Deploy with Docker
|
## ⚓️ Deploy with Docker
|
||||||
|
|
||||||
```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.
|
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
|
### 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
|
### Prerequisites
|
||||||
|
|
||||||
|
@@ -40,20 +40,6 @@ func checkDSN(dataDir string) (string, error) {
|
|||||||
return dataDir, nil
|
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.
|
// GetDevProfile will return a profile for dev.
|
||||||
func GetProfile() *Profile {
|
func GetProfile() *Profile {
|
||||||
mode := os.Getenv("mode")
|
mode := os.Getenv("mode")
|
||||||
@@ -79,12 +65,10 @@ func GetProfile() *Profile {
|
|||||||
|
|
||||||
dsn := fmt.Sprintf("%s/memos_%s.db", dataDir, mode)
|
dsn := fmt.Sprintf("%s/memos_%s.db", dataDir, mode)
|
||||||
|
|
||||||
version := getSystemVersion()
|
|
||||||
|
|
||||||
return &Profile{
|
return &Profile{
|
||||||
Mode: mode,
|
Mode: mode,
|
||||||
Port: port,
|
Port: port,
|
||||||
DSN: dsn,
|
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"
|
Reference in New Issue
Block a user