Documentation
¶
Index ¶
- Constants
- Variables
- func CreateRandomConfigValue() string
- func Execute(ctx context.Context) error
- func GetCurrentVersion() string
- func GetLatestVersion(ctx context.Context) (string, error)
- func IsCompletionCommand(cmd *cobra.Command) bool
- func SetupCommands(ctx context.Context, version string)
- type ColorMode
- type ExitCode
- type Mode
- type ServiceTableItem
Constants ¶
View Source
const DEFANG_PORTAL_HOST = "portal.defang.io"
View Source
const SERVICE_PORTAL_URL = "https://" + DEFANG_PORTAL_HOST + "/service"
Variables ¶
View Source
var P = track.P
View Source
var RootCmd = &cobra.Command{ SilenceUsage: true, SilenceErrors: true, Use: "defang", Args: cobra.NoArgs, Short: "Defang CLI is used to take your app from Docker Compose to a secure and scalable deployment on your favorite cloud in minutes.", PersistentPreRunE: func(cmd *cobra.Command, args []string) (err error) { ctx := cmd.Context() term.SetDebug(doDebug) if IsCompletionCommand(cmd) { return nil } defer func() { track.Cmd(cmd, "Invoked", P("args", args), P("err", err), P("non-interactive", nonInteractive), P("provider", providerID)) }() switch colorMode { case ColorNever: term.ForceColor(false) case ColorAlways: term.ForceColor(true) } if cwd, _ := cmd.Flags().GetString("cwd"); cwd != "" { if err = os.Chdir(cwd); err != nil { return err } } client, err = cli.Connect(ctx, getCluster()) if v, err := client.GetVersions(ctx); err == nil { version := cmd.Root().Version term.Debug("Fabric:", v.Fabric, "CLI:", version, "CLI-Min:", v.CliMin) if hasTty && isNewer(version, v.CliMin) && !isUpgradeCommand(cmd) { term.Warn("Your CLI version is outdated. Please upgrade to the latest version by running:\n\n defang upgrade\n") hideUpdate = true } } if _, ok := cmd.Annotations[authNeeded]; !ok { return nil } if nonInteractive { err = client.CheckLoginAndToS(ctx) } else { err = login.InteractiveRequireLoginAndToS(ctx, client, getCluster()) } return err }, }
Functions ¶
func CreateRandomConfigValue ¶
func CreateRandomConfigValue() string
func GetCurrentVersion ¶
func GetCurrentVersion() string
func IsCompletionCommand ¶
func SetupCommands ¶
Types ¶
type Mode ¶
type Mode defangv1.DeploymentMode
func (Mode) Value ¶
func (b Mode) Value() defangv1.DeploymentMode
Click to show internal directories.
Click to hide internal directories.