This repository has been archived by the owner on Jan 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add run & version sub-commands (#27)
- Loading branch information
Showing
21 changed files
with
769 additions
and
1,241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package main | ||
|
||
import ( | ||
_ "net/http/pprof" | ||
"os" | ||
|
||
gearmand "github.com/appscode/g2/pkg/server" | ||
"github.com/appscode/go/runtime" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func NewCmdRun() *cobra.Command { | ||
var cfg gearmand.Config | ||
|
||
cmd := &cobra.Command{ | ||
Use: "run", | ||
Short: "Run Gearman server", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
defer runtime.HandleCrash() | ||
gearmand.NewServer(cfg).Start() | ||
}, | ||
} | ||
|
||
cmd.Flags().StringVar(&cfg.ListenAddr, "addr", ":4730", "listening on, such as 0.0.0.0:4730") | ||
cmd.Flags().StringVar(&cfg.Storage, "storage-dir", os.TempDir()+"/gearmand", "Directory where LevelDB file is stored.") | ||
cmd.Flags().StringVar(&cfg.WebAddress, "web.addr", ":3000", "Server HTTP api Address") | ||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package main | ||
|
||
import ( | ||
v "github.com/appscode/go/version" | ||
) | ||
|
||
var ( | ||
Version string | ||
VersionStrategy string | ||
Os string | ||
Arch string | ||
CommitHash string | ||
GitBranch string | ||
GitTag string | ||
CommitTimestamp string | ||
BuildTimestamp string | ||
BuildHost string | ||
BuildHostOs string | ||
BuildHostArch string | ||
) | ||
|
||
func init() { | ||
v.Version.Version = Version | ||
v.Version.VersionStrategy = VersionStrategy | ||
v.Version.Os = Os | ||
v.Version.Arch = Arch | ||
v.Version.CommitHash = CommitHash | ||
v.Version.GitBranch = GitBranch | ||
v.Version.GitTag = GitTag | ||
v.Version.CommitTimestamp = CommitTimestamp | ||
v.Version.BuildTimestamp = BuildTimestamp | ||
v.Version.BuildHost = BuildHost | ||
v.Version.BuildHostOs = BuildHostOs | ||
v.Version.BuildHostArch = BuildHostArch | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.