main.go 636 B

123456789101112131415161718192021222324252627282930313233
  1. package main
  2. import (
  3. "log"
  4. "os"
  5. "bitbucket.org/robert2206/automation/cmd"
  6. "bitbucket.org/robert2206/automation/modules/models"
  7. "bitbucket.org/robert2206/automation/modules/settings"
  8. "github.com/urfave/cli"
  9. )
  10. func init() {
  11. settings.Init()
  12. models.Init()
  13. }
  14. func main() {
  15. app := cli.NewApp()
  16. app.Name = "Eiru Automation"
  17. app.Usage = "A ligthweight eiru automation for docker and odoo"
  18. app.Commands = []cli.Command{
  19. cmd.APICmd,
  20. }
  21. app.Flags = append(app.Flags, []cli.Flag{}...)
  22. app.Action = cmd.APICmd.Action
  23. err := app.Run(os.Args)
  24. if err != nil {
  25. log.Fatal(4, "Failed to run app with %s: %v", os.Args, err)
  26. }
  27. }