Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ go = "1.25"
[env]
CGO_ENABLED=0
LGFLAGS="-extldflags '-static'"
SKPR_API="localhost:50051?insecure=true"
SKPR_SSH="localhost:2222"
SKPR_PROJECT="drupal"

[tasks.vendor]
description = "Vendor resets the main module's vendor directory to include all packages needed to build the application"
Expand Down
5 changes: 3 additions & 2 deletions cmd/skpr-rsh/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package main

import (
"context"
"os"

wfclient "github.com/skpr/cli/internal/client"
"github.com/skpr/cli/internal/client"
"github.com/skpr/cli/internal/client/ssh"
)

Expand All @@ -24,7 +25,7 @@ import (
//
// See the "skpr rsync" command for how this is implemented.
func main() {
client, _, err := wfclient.NewFromFile()
_, client, err := client.New(context.TODO())
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/skpr/alias/delete/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package delete
import (
"github.com/spf13/cobra"

v1delete "github.com/skpr/cli/internal/command/v1/alias/delete"
v1delete "github.com/skpr/cli/internal/command/alias/delete"
)

var (
Expand Down Expand Up @@ -31,7 +31,7 @@ func NewCommand() *cobra.Command {
Example: cmdExample,
RunE: func(cmd *cobra.Command, args []string) error {
command.Alias = args[0]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/skpr/alias/list/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package list
import (
"github.com/spf13/cobra"

v1list "github.com/skpr/cli/internal/command/v1/alias/list"
v1list "github.com/skpr/cli/internal/command/alias/list"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/skpr/alias/set/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package set
import (
"github.com/spf13/cobra"

v1set "github.com/skpr/cli/internal/command/v1/alias/set"
v1set "github.com/skpr/cli/internal/command/alias/set"
)

var (
Expand Down
5 changes: 2 additions & 3 deletions cmd/skpr/backup/create/command.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package create

import (
v1create "github.com/skpr/cli/internal/command/backup/create"
"time"

"github.com/spf13/cobra"

v1create "github.com/skpr/cli/internal/command/v1/backup/create"
)

var (
Expand Down Expand Up @@ -33,7 +32,7 @@ func NewCommand() *cobra.Command {
Example: cmdExample,
RunE: func(cmd *cobra.Command, args []string) error {
command.Environment = args[0]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
5 changes: 2 additions & 3 deletions cmd/skpr/backup/list/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package list

import (
v1list "github.com/skpr/cli/internal/command/backup/list"
"github.com/spf13/cobra"

v1list "github.com/skpr/cli/internal/command/v1/backup/list"
)

var (
Expand Down Expand Up @@ -34,7 +33,7 @@ func NewCommand() *cobra.Command {
Example: cmdExample,
RunE: func(cmd *cobra.Command, args []string) error {
command.Environment = args[0]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
5 changes: 2 additions & 3 deletions cmd/skpr/config/delete/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package delete

import (
v1delete "github.com/skpr/cli/internal/command/config/delete"
"github.com/spf13/cobra"

v1delete "github.com/skpr/cli/internal/command/v1/config/delete"
)

var (
Expand All @@ -29,7 +28,7 @@ func NewCommand() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
command.Environment = args[0]
command.Key = args[1]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
5 changes: 2 additions & 3 deletions cmd/skpr/config/get/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package get

import (
v1get "github.com/skpr/cli/internal/command/config/get"
"github.com/spf13/cobra"

v1get "github.com/skpr/cli/internal/command/v1/config/get"
)

var (
Expand All @@ -29,7 +28,7 @@ func NewCommand() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
command.Environment = args[0]
command.Key = args[1]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
5 changes: 2 additions & 3 deletions cmd/skpr/config/list/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package list

import (
v1list "github.com/skpr/cli/internal/command/config/list"
"github.com/spf13/cobra"

v1list "github.com/skpr/cli/internal/command/v1/config/list"
)

const (
Expand Down Expand Up @@ -39,7 +38,7 @@ func NewCommand() *cobra.Command {
Example: cmdExample,
RunE: func(cmd *cobra.Command, args []string) error {
command.Environment = args[0]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
5 changes: 2 additions & 3 deletions cmd/skpr/config/set/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package set

import (
v1set "github.com/skpr/cli/internal/command/config/set"
"github.com/spf13/cobra"

v1set "github.com/skpr/cli/internal/command/v1/config/set"
)

var (
Expand All @@ -30,7 +29,7 @@ func NewCommand() *cobra.Command {
command.Environment = args[0]
command.Key = args[1]
command.Value = args[2]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
5 changes: 2 additions & 3 deletions cmd/skpr/create/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package create

import (
v1create "github.com/skpr/cli/internal/command/create"
"github.com/spf13/cobra"

v1create "github.com/skpr/cli/internal/command/v1/create"
)

var (
Expand All @@ -28,7 +27,7 @@ func NewCommand() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
command.Environment = args[0]
command.Version = args[1]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
7 changes: 3 additions & 4 deletions cmd/skpr/delete/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package delete

import (
v1delete "github.com/skpr/cli/internal/command/delete"
"github.com/spf13/cobra"

v1delete "github.com/skpr/cli/internal/command/v1/delete"
)

var (
Expand All @@ -20,15 +19,15 @@ func NewCommand() *cobra.Command {
command := v1delete.Command{}

cmd := &cobra.Command{
Use: "delete <environment>",
Use: "delete [environment]",
Args: cobra.ExactArgs(1),
DisableFlagsInUseLine: true,
Short: "Delete a previously deployed environment",
Long: cmdLong,
Example: cmdExample,
RunE: func(cmd *cobra.Command, args []string) error {
command.Name = args[0]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
5 changes: 2 additions & 3 deletions cmd/skpr/deploy/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package deploy

import (
v1deploy "github.com/skpr/cli/internal/command/deploy"
"github.com/spf13/cobra"

v1deploy "github.com/skpr/cli/internal/command/v1/deploy"
)

var (
Expand All @@ -29,7 +28,7 @@ func NewCommand() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
command.Environment = args[0]
command.Version = args[1]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
5 changes: 2 additions & 3 deletions cmd/skpr/exec/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package exec

import (
v1exec "github.com/skpr/cli/internal/command/exec"
"github.com/spf13/cobra"

v1exec "github.com/skpr/cli/internal/command/v1/exec"
)

var (
Expand All @@ -29,7 +28,7 @@ func NewCommand() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
command.Environment = args[0]
command.Command = args[1:]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
5 changes: 2 additions & 3 deletions cmd/skpr/info/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package info

import (
v1info "github.com/skpr/cli/internal/command/info"
"github.com/spf13/cobra"

v1info "github.com/skpr/cli/internal/command/v1/info"
)

var (
Expand All @@ -28,7 +27,7 @@ func NewCommand() *cobra.Command {
Example: cmdExample,
RunE: func(cmd *cobra.Command, args []string) error {
command.Name = args[0]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
9 changes: 3 additions & 6 deletions cmd/skpr/list/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package list

import (
v1list "github.com/skpr/cli/internal/command/list"
"github.com/spf13/cobra"

v1list "github.com/skpr/cli/internal/command/v1/list"
)

var (
Expand All @@ -26,10 +25,8 @@ func NewCommand() *cobra.Command {
Short: "Overview of all environments and their current status",
Long: cmdLong,
Example: cmdExample,
Run: func(cmd *cobra.Command, args []string) {
if err := command.Run(); err != nil {
panic(err)
}
RunE: func(cmd *cobra.Command, args []string) error {
return command.Run(cmd.Context())
},
}

Expand Down
8 changes: 3 additions & 5 deletions cmd/skpr/login/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package login

import (
v1login "github.com/skpr/cli/internal/command/login"
"github.com/spf13/cobra"

v1login "github.com/skpr/cli/internal/command/v1/login"
)

var (
Expand All @@ -22,12 +21,11 @@ func NewCommand() *cobra.Command {
Use: "login",
DisableFlagsInUseLine: true,
Short: "Login to the Skpr cluster.",
Args: cobra.ExactArgs(1),
Args: cobra.NoArgs,
Long: cmdLong,
Example: cmdExample,
RunE: func(cmd *cobra.Command, args []string) error {
command.Callback = args[0]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
7 changes: 3 additions & 4 deletions cmd/skpr/logout/command.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package logout

import (
v1logout "github.com/skpr/cli/internal/command/logout"
"github.com/spf13/cobra"

v1logout "github.com/skpr/cli/internal/command/v1/logout"
)

var (
Expand All @@ -22,11 +21,11 @@ func NewCommand() *cobra.Command {
Use: "logout",
DisableFlagsInUseLine: true,
Short: "Initiate a logout event from the Skpr hosting plstform",
Args: cobra.NoArgs,
Long: cmdLong,
Example: cmdExample,
RunE: func(cmd *cobra.Command, args []string) error {
command.Callback = args[0]
return command.Run()
return command.Run(cmd.Context())
},
}

Expand Down
5 changes: 3 additions & 2 deletions cmd/skpr/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package main

import (
"context"
"os"

"github.com/charmbracelet/fang"
"github.com/charmbracelet/lipgloss/v2"
"github.com/skpr/cli/internal/color"
"github.com/spf13/cobra"
"os"

"github.com/skpr/cli/cmd/skpr/alias"
"github.com/skpr/cli/cmd/skpr/backup"
Expand All @@ -27,6 +27,7 @@ import (
"github.com/skpr/cli/cmd/skpr/rsync"
"github.com/skpr/cli/cmd/skpr/shell"
"github.com/skpr/cli/cmd/skpr/version"
"github.com/skpr/cli/internal/color"
)

const cmdExample = `
Expand Down
Loading