Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AgentCommand = &cobra.Command{ Use: "agent", Short: "agent", RunE: func(c *cobra.Command, args []string) error { if len(args) == 0 { c.Help() } return nil }, }
View Source
var AgentPackageCommand = &cobra.Command{ Use: "package", Short: "package agent into a tar.gz file", RunE: func(cmd *cobra.Command, args []string) error { if len(args) == 0 { cmd.Help() return nil } path := args[0] command := exec.Command("tar", "-cf", path, "dist", ".env", "octopus", "config") out, err := command.CombinedOutput() fmt.Println(string(out)) if err != nil { return err } return nil }, }
View Source
var AgentRegisterLocalCommand = &cobra.Command{ Use: "register", Short: "register to host as a service", RunE: func(cmd *cobra.Command, args []string) error { container := cmd.GetContainer() agentService := container.MustMake(agent.AgentKey).(agent.IService) if err := agentService.Register(); err != nil { return err } return nil }, }
View Source
var AgentRunScriptCommand = &cobra.Command{ Use: "script", Short: "run a specific script in exec.Command, ./yogo agent script ./demo.sh", RunE: func(cmd *cobra.Command, args []string) error { if len(args) == 0 { cmd.Help() return nil } path := args[0] content, err := os.ReadFile(path) if err != nil { return err } container := cmd.GetContainer() writer := os.Stdout agentService := container.MustMake(agent.AgentKey).(agent.IService) if err := agentService.RunScript(content, writer); err != nil { return err } return nil }, }
View Source
var AgentStatusCommand = &cobra.Command{ Use: "status", Short: "status of octopus-agent.service", RunE: func(cmd *cobra.Command, args []string) error { container := cmd.GetContainer() agentService := container.MustMake(agent.AgentKey).(agent.IService) if err := agentService.Status(); err != nil { return err } return nil }, }
Functions ¶
func InitAgentCommand ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.