terminology: rename layout -> plan
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
@@ -33,9 +33,9 @@ var computeCmd = &cobra.Command{
|
||||
ctx := lg.WithContext(cmd.Context())
|
||||
|
||||
st := &dagger.DeploymentState{
|
||||
ID: uuid.New().String(),
|
||||
Name: "FIXME",
|
||||
LayoutSource: dagger.DirInput(args[0], []string{"*.cue", "cue.mod"}),
|
||||
ID: uuid.New().String(),
|
||||
Name: "FIXME",
|
||||
PlanSource: dagger.DirInput(args[0], []string{"*.cue", "cue.mod"}),
|
||||
}
|
||||
|
||||
for _, input := range viper.GetStringSlice("input-string") {
|
||||
|
@@ -34,8 +34,8 @@ var newCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
st := &dagger.DeploymentState{
|
||||
Name: getNewDeploymentName(ctx),
|
||||
LayoutSource: getLayoutSource(ctx),
|
||||
Name: getNewDeploymentName(ctx),
|
||||
PlanSource: getPlanSource(ctx),
|
||||
}
|
||||
|
||||
err = store.CreateDeployment(ctx, st)
|
||||
@@ -86,8 +86,8 @@ func getNewDeploymentName(ctx context.Context) string {
|
||||
return currentDir
|
||||
}
|
||||
|
||||
// FIXME: Implement options: --layout-*
|
||||
func getLayoutSource(ctx context.Context) dagger.Input {
|
||||
// FIXME: Implement options: --plan-*
|
||||
func getPlanSource(ctx context.Context) dagger.Input {
|
||||
lg := log.Ctx(ctx)
|
||||
|
||||
wd, err := os.Getwd()
|
||||
@@ -102,10 +102,10 @@ func init() {
|
||||
newCmd.Flags().StringP("name", "n", "", "Specify a deployment name")
|
||||
newCmd.Flags().BoolP("up", "u", false, "Bring the deployment online")
|
||||
|
||||
newCmd.Flags().String("layout-dir", "", "Load layout from a local directory")
|
||||
newCmd.Flags().String("layout-git", "", "Load layout from a git repository")
|
||||
newCmd.Flags().String("layout-package", "", "Load layout from a cue package")
|
||||
newCmd.Flags().String("layout-file", "", "Load layout from a cue or json file")
|
||||
newCmd.Flags().String("plan-dir", "", "Load plan from a local directory")
|
||||
newCmd.Flags().String("plan-git", "", "Load plan from a git repository")
|
||||
newCmd.Flags().String("plan-package", "", "Load plan from a cue package")
|
||||
newCmd.Flags().String("plan-file", "", "Load plan from a cue or json file")
|
||||
|
||||
newCmd.Flags().String("setup", "auto", "Specify whether to prompt user for initial setup (no|yes|auto)")
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package layout
|
||||
package plan
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
var dirCmd = &cobra.Command{
|
||||
Use: "dir PATH",
|
||||
Short: "Load layout from a local directory",
|
||||
Short: "Load plan from a local directory",
|
||||
Args: cobra.ExactArgs(1),
|
||||
PreRun: func(cmd *cobra.Command, args []string) {
|
||||
// Fix Viper bug for duplicate flags:
|
@@ -1,4 +1,4 @@
|
||||
package layout
|
||||
package plan
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
var fileCmd = &cobra.Command{
|
||||
Use: "file PATH|-",
|
||||
Short: "Load layout from a cue file",
|
||||
Short: "Load plan from a cue file",
|
||||
Args: cobra.ExactArgs(1),
|
||||
PreRun: func(cmd *cobra.Command, args []string) {
|
||||
// Fix Viper bug for duplicate flags:
|
@@ -1,4 +1,4 @@
|
||||
package layout
|
||||
package plan
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
var gitCmd = &cobra.Command{
|
||||
Use: "git REMOTE REF [SUBDIR]",
|
||||
Short: "Load layout from a git package",
|
||||
Short: "Load plan from a git package",
|
||||
Args: cobra.MinimumNArgs(2),
|
||||
PreRun: func(cmd *cobra.Command, args []string) {
|
||||
// Fix Viper bug for duplicate flags:
|
@@ -1,4 +1,4 @@
|
||||
package layout
|
||||
package plan
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
var packageCmd = &cobra.Command{
|
||||
Use: "package PKG",
|
||||
Short: "Load layout from a cue package",
|
||||
Short: "Load plan from a cue package",
|
||||
Args: cobra.ExactArgs(1),
|
||||
PreRun: func(cmd *cobra.Command, args []string) {
|
||||
// Fix Viper bug for duplicate flags:
|
@@ -1,11 +1,11 @@
|
||||
package layout
|
||||
package plan
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
// Cmd exposes the top-level command
|
||||
var Cmd = &cobra.Command{
|
||||
Use: "layout",
|
||||
Short: "Manage a deployment's layout",
|
||||
Use: "plan",
|
||||
Short: "Manage a deployment's plan",
|
||||
}
|
||||
|
||||
func init() {
|
@@ -57,7 +57,7 @@ func init() {
|
||||
|
||||
queryCmd.Flags().BoolP("--no-input", "I", false, "Exclude inputs from query")
|
||||
queryCmd.Flags().BoolP("--no-output", "O", false, "Exclude outputs from query")
|
||||
queryCmd.Flags().BoolP("--no-layout", "L", false, "Exclude outputs from query")
|
||||
queryCmd.Flags().BoolP("--no-plan", "P", false, "Exclude outputs from query")
|
||||
|
||||
if err := viper.BindPFlags(queryCmd.Flags()); err != nil {
|
||||
panic(err)
|
||||
|
@@ -5,8 +5,8 @@ import (
|
||||
"strings"
|
||||
|
||||
inputCmd "dagger.io/go/cmd/dagger/cmd/input"
|
||||
"dagger.io/go/cmd/dagger/cmd/layout"
|
||||
"dagger.io/go/cmd/dagger/cmd/output"
|
||||
"dagger.io/go/cmd/dagger/cmd/plan"
|
||||
"dagger.io/go/cmd/dagger/logger"
|
||||
"github.com/moby/buildkit/util/appcontext"
|
||||
"github.com/opentracing/opentracing-go"
|
||||
@@ -36,7 +36,7 @@ func init() {
|
||||
historyCmd,
|
||||
loginCmd,
|
||||
logoutCmd,
|
||||
layout.Cmd,
|
||||
plan.Cmd,
|
||||
inputCmd.Cmd,
|
||||
output.Cmd,
|
||||
)
|
||||
|
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
var upCmd = &cobra.Command{
|
||||
Use: "up",
|
||||
Short: "Bring a deployment online with latest layout and inputs",
|
||||
Short: "Bring a deployment online with latest plan and inputs",
|
||||
Args: cobra.NoArgs,
|
||||
PreRun: func(cmd *cobra.Command, args []string) {
|
||||
// Fix Viper bug for duplicate flags:
|
||||
|
Reference in New Issue
Block a user