forked from getfider/fider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
44 lines (36 loc) · 986 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
"os"
"runtime"
"github.com/getfider/fider/app/cmd"
"github.com/getfider/fider/app/models"
"github.com/getfider/fider/app/pkg/env"
_ "github.com/lib/pq"
_ "github.com/mattes/migrate/database/postgres"
_ "github.com/mattes/migrate/source/file"
)
// replaced during CI build
var buildtime = ""
var buildnumber = "local"
// Use this for non-stable releases
// var version = "x.y.z-" + buildnumber
// Use this for stable releases
// var version = "x.y.z"
var version = "0.13.0-" + buildnumber
func main() {
settings := &models.SystemSettings{
BuildTime: buildtime,
Version: version,
Compiler: runtime.Version(),
Environment: env.Current(),
GoogleAnalytics: env.GetEnvOrDefault("GOOGLE_ANALYTICS", ""),
Mode: env.Mode(),
Domain: env.MultiTenantDomain(),
}
args := os.Args[1:]
if len(args) > 0 && args[0] == "ping" {
os.Exit(cmd.RunPing())
} else {
os.Exit(cmd.RunServer(settings))
}
}