-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboot.go
59 lines (49 loc) · 1.02 KB
/
boot.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
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"fmt"
"os"
"runtime"
"github.com/codegangsta/cli"
)
const (
serverConfAppName = "deis-builder-server"
gitReceiveConfAppName = "deis-builder-git-receive"
gitHomeDir = "/Users/smothiki/git"
)
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
}
func main() {
app := cli.NewApp()
app.Commands = []cli.Command{
{
Name: "server",
Aliases: []string{"srv"},
Usage: "Run the git server",
Action: func(c *cli.Context) {
cfg, err := Configure()
if err != nil {
fmt.Printf("config error%v\n", err)
}
err = Serve(cfg, gitHomeDir, "localhost:2223", "gitreceive")
if err != nil {
fmt.Println(err)
}
fmt.Println("here")
for {
}
},
},
{
Name: "git-receive",
Aliases: []string{"gr"},
Usage: "Run the git-receive hook",
Action: func(c *cli.Context) {
// if err := gitreceive.Run(cnf); err != nil {
// log.Printf("Error running git receive hook [%s]", err)
// os.Exit(1)
},
},
}
app.Run(os.Args)
}