forked from gojek/proctor
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Anirudh M <m.anirudh18@gmail.com>
- Loading branch information
1 parent
8343952
commit f3beccf
Showing
4 changed files
with
150 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
cli | ||
server | ||
|
||
|
||
homebrew-gojek | ||
scripts/proctor.rb | ||
_output/* | ||
|
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,18 @@ | ||
package main | ||
|
||
import ( | ||
"proctor/cmd" | ||
"proctor/config" | ||
"proctor/daemon" | ||
"proctor/io" | ||
"proctor/cmd/version/github" | ||
) | ||
|
||
func main() { | ||
printer := io.GetPrinter() | ||
proctorConfigLoader := config.NewLoader() | ||
proctorDClient := daemon.NewClient(printer, proctorConfigLoader) | ||
githubClient := github.NewClient() | ||
|
||
cmd.Execute(printer, proctorDClient, githubClient) | ||
} |
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,65 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/getsentry/raven-go" | ||
"github.com/urfave/cli" | ||
|
||
"proctor/proctord/config" | ||
"proctor/proctord/logger" | ||
"proctor/proctord/scheduler" | ||
"proctor/proctord/server" | ||
"proctor/proctord/storage/postgres" | ||
) | ||
|
||
func main() { | ||
logger.Setup() | ||
raven.SetDSN(config.SentryDSN()) | ||
|
||
proctord := cli.NewApp() | ||
proctord.Name = "proctord" | ||
proctord.Usage = "Handle executing jobs and maintaining their configuration" | ||
proctord.Version = "0.2.0" | ||
proctord.Commands = []cli.Command{ | ||
{ | ||
Name: "migrate", | ||
Description: "Run database migrations for proctord", | ||
Action: func(c *cli.Context) { | ||
err := postgres.Up() | ||
if err != nil { | ||
panic(err.Error()) | ||
} | ||
logger.Info("Migration successful") | ||
}, | ||
}, | ||
{ | ||
Name: "rollback", | ||
Description: "Rollback database migrations by one step for proctord", | ||
Action: func(c *cli.Context) { | ||
err := postgres.DownOneStep() | ||
if err != nil { | ||
panic(err.Error()) | ||
} | ||
logger.Info("Rollback successful") | ||
}, | ||
}, | ||
{ | ||
Name: "start", | ||
Aliases: []string{"s"}, | ||
Usage: "starts server", | ||
Action: func(c *cli.Context) error { | ||
return server.Start() | ||
}, | ||
}, | ||
{ | ||
Name: "start-scheduler", | ||
Usage: "starts scheduler", | ||
Action: func(c *cli.Context) error { | ||
return scheduler.Start() | ||
}, | ||
}, | ||
} | ||
|
||
proctord.Run(os.Args) | ||
} |
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,65 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/getsentry/raven-go" | ||
"github.com/urfave/cli" | ||
|
||
"proctor/proctord/config" | ||
"proctor/proctord/logger" | ||
"proctor/proctord/scheduler" | ||
"proctor/proctord/server" | ||
"proctor/proctord/storage/postgres" | ||
) | ||
|
||
func main() { | ||
logger.Setup() | ||
raven.SetDSN(config.SentryDSN()) | ||
|
||
proctord := cli.NewApp() | ||
proctord.Name = "proctord" | ||
proctord.Usage = "Handle executing jobs and maintaining their configuration" | ||
proctord.Version = "0.2.0" | ||
proctord.Commands = []cli.Command{ | ||
{ | ||
Name: "migrate", | ||
Description: "Run database migrations for proctord", | ||
Action: func(c *cli.Context) { | ||
err := postgres.Up() | ||
if err != nil { | ||
panic(err.Error()) | ||
} | ||
logger.Info("Migration successful") | ||
}, | ||
}, | ||
{ | ||
Name: "rollback", | ||
Description: "Rollback database migrations by one step for proctord", | ||
Action: func(c *cli.Context) { | ||
err := postgres.DownOneStep() | ||
if err != nil { | ||
panic(err.Error()) | ||
} | ||
logger.Info("Rollback successful") | ||
}, | ||
}, | ||
{ | ||
Name: "start", | ||
Aliases: []string{"s"}, | ||
Usage: "starts server", | ||
Action: func(c *cli.Context) error { | ||
return server.Start() | ||
}, | ||
}, | ||
{ | ||
Name: "start-scheduler", | ||
Usage: "starts scheduler", | ||
Action: func(c *cli.Context) error { | ||
return scheduler.Start() | ||
}, | ||
}, | ||
} | ||
|
||
proctord.Run(os.Args) | ||
} |