Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
0b50122a
Commit
0b50122a
authored
May 17, 2022
by
boojack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: version getter
parent
5731fb89
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
22 deletions
+9
-22
build-and-push-dev-image.yml
.github/workflows/build-and-push-dev-image.yml
+1
-1
build-and-push-release-image.yml
.github/workflows/build-and-push-release-image.yml
+1
-1
README.md
README.md
+2
-2
VERSION
VERSION
+0
-1
profile.go
common/profile.go
+1
-17
version.go
common/version.go
+4
-0
No files found.
.github/workflows/build-and-push-dev-image.yml
View file @
0b50122a
...
@@ -6,7 +6,7 @@ on:
...
@@ -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
...
...
.github/workflows/build-and-push-release-image.yml
View file @
0b50122a
...
@@ -7,7 +7,7 @@ on:
...
@@ -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
...
...
README.md
View file @
0b50122a
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
## ⚓️ Deploy with Docker
## ⚓️ Deploy with Docker
```
docker
```
docker
docker run --name memos --publish
808
0:8080 --volume ~/.memos/:/var/opt/memos -e mode=prod neosmemo/memos:0.0.1
docker run --name memos --publish
523
0: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
...
@@ -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=
"3
2
0"
/>
<img
alt=
"tech stack"
src=
"https://raw.githubusercontent.com/justmemos/memos/main/resources/tech-stack.png"
width=
"3
6
0"
/>
### Prerequisites
### Prerequisites
...
...
VERSION
deleted
100644 → 0
View file @
5731fb89
0.0.1
\ No newline at end of file
common/profile.go
View file @
0b50122a
...
@@ -40,20 +40,6 @@ func checkDSN(dataDir string) (string, error) {
...
@@ -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 {
...
@@ -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
:
v
ersion
,
Version
:
V
ersion
,
}
}
}
}
common/version.go
0 → 100644
View file @
0b50122a
package
common
// Version is the service current released version.
var
Version
=
"0.0.1"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment