Skip to content

Commit

Permalink
Update to github.com/urfave/cli/v2 & gopkg.in/yaml.v3
Browse files Browse the repository at this point in the history
  • Loading branch information
0rax committed Feb 20, 2024
1 parent b8d03da commit 9352340
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 57 deletions.
2 changes: 1 addition & 1 deletion commands/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"runtime"
"strings"

"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"github.com/wsxiaoys/terminal"

"github.com/tifo/orchestra/services"
Expand Down
2 changes: 1 addition & 1 deletion commands/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package commands
import (
"fmt"

"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"github.com/wsxiaoys/terminal"

"github.com/tifo/orchestra/config"
Expand Down
2 changes: 1 addition & 1 deletion commands/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"runtime"
"strings"

"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"github.com/wsxiaoys/terminal"

"github.com/tifo/orchestra/services"
Expand Down
2 changes: 1 addition & 1 deletion commands/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

log "github.com/cihub/seelog"
"github.com/tenebris-tech/tail"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"github.com/wsxiaoys/terminal"

"github.com/tifo/orchestra/services"
Expand Down
2 changes: 1 addition & 1 deletion commands/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"sync"

"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"github.com/wsxiaoys/terminal"

"github.com/tifo/orchestra/services"
Expand Down
6 changes: 3 additions & 3 deletions commands/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"runtime"
"strings"

"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"github.com/wsxiaoys/terminal"

"github.com/tifo/orchestra/services"
Expand All @@ -16,11 +16,11 @@ var RestartCommand = &cli.Command{
Action: BeforeAfterWrapper(RestartAction),
BashComplete: ServicesBashComplete,
Flags: []cli.Flag{
cli.BoolFlag{
&cli.BoolFlag{
Name: "attach, a",
Usage: "Attach to services output after start",
},
cli.BoolFlag{
&cli.BoolFlag{
Name: "logs, l",
Usage: "Start logging after start",
},
Expand Down
6 changes: 3 additions & 3 deletions commands/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"syscall"
"time"

"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"github.com/wsxiaoys/terminal"

"github.com/tifo/orchestra/services"
Expand All @@ -22,11 +22,11 @@ var StartCommand = &cli.Command{
Action: BeforeAfterWrapper(StartAction),
BashComplete: ServicesBashComplete,
Flags: []cli.Flag{
cli.BoolFlag{
&cli.BoolFlag{
Name: "attach, a",
Usage: "Attach to services output after start",
},
cli.BoolFlag{
&cli.BoolFlag{
Name: "logs, l",
Usage: "Start logging after start",
},
Expand Down
2 changes: 1 addition & 1 deletion commands/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"strings"

"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"github.com/wsxiaoys/terminal"

"github.com/tifo/orchestra/services"
Expand Down
6 changes: 3 additions & 3 deletions commands/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os/exec"
"strings"

"github.com/urfave/cli"
"github.com/urfave/cli/v2"
"github.com/wsxiaoys/terminal"

"github.com/tifo/orchestra/services"
Expand All @@ -18,10 +18,10 @@ var TestCommand = &cli.Command{
Action: BeforeAfterWrapper(TestAction),
BashComplete: ServicesBashComplete,
Flags: []cli.Flag{
cli.BoolFlag{
&cli.BoolFlag{
Name: "verbose, v",
},
cli.BoolFlag{
&cli.BoolFlag{
Name: "race, r",
},
},
Expand Down
4 changes: 2 additions & 2 deletions commands/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"

log "github.com/cihub/seelog"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"

"github.com/tifo/orchestra/config"
"github.com/tifo/orchestra/services"
Expand All @@ -20,7 +20,7 @@ const niceness = "1"
// This is temporary, very very alpha and may change soon
func FilterServices(c *cli.Context) map[string]*services.Service {
excludeMode := 0
args := c.Args()
args := c.Args().Slice()
for _, s := range args {
name := s
if strings.HasPrefix(s, "~") {
Expand Down
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strings"

log "github.com/cihub/seelog"
"github.com/urfave/cli"
"gopkg.in/yaml.v2"
"github.com/urfave/cli/v2"
"gopkg.in/yaml.v3"
)

var orchestra *Config
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ go 1.18
require (
github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575
github.com/tenebris-tech/tail v1.0.5
github.com/urfave/cli v1.22.14
github.com/urfave/cli/v2 v2.27.1
github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/sys v0.16.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
)
23 changes: 4 additions & 19 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,39 +1,24 @@
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1c8PVE1PubbNx3mjUr09OqWGCs=
github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tenebris-tech/tail v1.0.5 h1:gKDA1qEP+kxG/SqaFzJWC/5jLHlG1y4hgibSPHdicrY=
github.com/tenebris-tech/tail v1.0.5/go.mod h1:RpxaZO+UNwbKgXA6VzHdR5FTLTM0pk9zZU/mmHxUeZQ=
github.com/urfave/cli v1.22.14 h1:ebbhrRiGK2i4naQJr+1Xj92HXZCrK7MsyTS/ob3HnAk=
github.com/urfave/cli v1.22.14/go.mod h1:X0eDS6pD6Exaclxm99NJ3FiCDRED7vIHpx2mDOHLvkA=
github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho=
github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0 h1:3UeQBvD0TFrlVjOeLOBz+CPAI8dnbqNSVwUwRrkp7vQ=
github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0/go.mod h1:IXCdmsXIht47RaVFLEdVnh1t+pgYtTAhQGj73kz+2DM=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
32 changes: 16 additions & 16 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"

log "github.com/cihub/seelog"
"github.com/urfave/cli"
"github.com/urfave/cli/v2"

"github.com/tifo/orchestra/commands"
"github.com/tifo/orchestra/config"
Expand Down Expand Up @@ -45,28 +45,28 @@ func main() {
app.Name = "Orchestra"
app.Usage = "Orchestrate Go Services (Tifo)"
app.EnableBashCompletion = true
app.Commands = []cli.Command{
*commands.BuildCommand,
*commands.ExportCommand,
*commands.InstallCommand,
*commands.LogsCommand,
*commands.PsCommand,
*commands.RestartCommand,
*commands.StartCommand,
*commands.StopCommand,
*commands.TestCommand,
app.Commands = []*cli.Command{
commands.BuildCommand,
commands.ExportCommand,
commands.InstallCommand,
commands.LogsCommand,
commands.PsCommand,
commands.RestartCommand,
commands.StartCommand,
commands.StopCommand,
commands.TestCommand,
}
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "config, c",
Usage: "Specify a different config file to use (default: \"orchestra.yml\"",
EnvVar: "ORCHESTRA_CONFIG",
&cli.StringFlag{
Name: "config, c",
Usage: "Specify a different config file to use (default: \"orchestra.yml\"",
EnvVars: []string{"ORCHESTRA_CONFIG"},
},
}
// init checks for an existing orchestra.yml in the current working directory
// and creates a new .orchestra directory (if doesn't exist)
app.Before = func(c *cli.Context) error {
confVal := c.GlobalString("config")
confVal := c.String("config")
if confVal == "" {
confVal = findConfigFile()
}
Expand Down
2 changes: 1 addition & 1 deletion services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"syscall"

log "github.com/cihub/seelog"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"

"github.com/tifo/orchestra/config"
)
Expand Down

0 comments on commit 9352340

Please sign in to comment.