forked from getfider/fider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
47 lines (39 loc) · 1007 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
45
46
47
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"
)
var (
// replaced during CI build
buildtime = ""
buildnumber = "local"
// Use this for non-stable releases
// version = "x.y.z-" + buildnumber
// Use this for stable releases
// version = "x.y.z"
version = "0.19.0-" + buildnumber
)
func main() {
settings := &models.SystemSettings{
BuildTime: buildtime,
Version: version,
Compiler: runtime.Version(),
Environment: env.Config.Environment,
GoogleAnalytics: env.Config.GoogleAnalytics,
Mode: env.Config.HostMode,
Domain: env.MultiTenantDomain(),
HasLegal: env.HasLegal(),
}
args := os.Args[1:]
if len(args) > 0 && args[0] == "ping" {
os.Exit(cmd.RunPing())
} else if len(args) > 0 && args[0] == "migrate" {
os.Exit(cmd.RunMigrate())
} else {
os.Exit(cmd.RunServer(settings))
}
}