diff --git a/cmd/agent.go b/cmd/agent.go index 38e53395..9729cc2a 100644 --- a/cmd/agent.go +++ b/cmd/agent.go @@ -170,6 +170,7 @@ func getAgentAuthType(logger logger.Logger, authType string) string { default: } } + auth := tui.Select(logger, "Select your Agent's webhook authentication method", "Do you want to secure the webhook or make it publicly available?", []tui.Option{ {Text: tui.PadRight("API Key", 10, " ") + tui.Muted("Bearer Token (will be generated for you)"), ID: "bearer"}, {Text: tui.PadRight("None", 10, " ") + tui.Muted("No Authentication Required"), ID: "none"}, diff --git a/cmd/cloud.go b/cmd/cloud.go index 02df3077..623a357f 100644 --- a/cmd/cloud.go +++ b/cmd/cloud.go @@ -69,9 +69,12 @@ type startAgent struct { } type startRequest struct { - Agents []startAgent `json:"agents"` - Resources *Resources `json:"resources,omitempty"` - Metadata *deployer.Metadata `json:"metadata,omitempty"` + Agents []startAgent `json:"agents"` + Resources *Resources `json:"resources,omitempty"` + Metadata *deployer.Metadata `json:"metadata,omitempty"` + Tag string `json:"tag,omitempty"` + TagMessage string `json:"tagMessage,omitempty"` + TagDescription string `json:"tagDescription,omitempty"` } func ShowNewProjectImport(ctx context.Context, logger logger.Logger, cmd *cobra.Command, apiUrl, apikey, projectId string, project *project.Project, dir string, isImport bool) { @@ -129,11 +132,14 @@ between local and remote agents. Flags: --dir The directory containing the project to deploy + --tag An optional tag for this deployment + --tag-message An optional message for the tag + --tag-description An optional description for the tag Examples: agentuity cloud deploy agentuity deploy - agentuity cloud deploy --dir /path/to/project`, + agentuity cloud deploy --dir /path/to/project --tag latest --tag-message "Latest Release" --tag-description "Some longer description"`, Run: func(cmd *cobra.Command, args []string) { parentCtx := context.Background() ctx, cancel := signal.NotifyContext(parentCtx, os.Interrupt, syscall.SIGINT, syscall.SIGTERM) @@ -146,6 +152,11 @@ Examples: appUrl := context.APPURL transportUrl := context.TransportURL token := context.Token + + tag, _ := cmd.Flags().GetString("tag") + tagMessage, _ := cmd.Flags().GetString("tag-message") + tagDescription, _ := cmd.Flags().GetString("tag-description") + ci, _ := cmd.Flags().GetBool("ci") ciRemoteUrl, _ := cmd.Flags().GetString("ci-remote-url") ciBranch, _ := cmd.Flags().GetString("ci-branch") @@ -400,6 +411,16 @@ Examples: }, } + if tag != "" { + startRequest.Tag = tag + } + if tagMessage != "" { + startRequest.TagMessage = tagMessage + } + if tagDescription != "" { + startRequest.TagDescription = tagDescription + } + // Start deployment if err := client.Do("PUT", fmt.Sprintf("/cli/deploy/start/%s%s", theproject.ProjectId, deploymentId), startRequest, &startResponse); err != nil { errsystem.New(errsystem.ErrDeployProject, err, @@ -664,6 +685,9 @@ func init() { cloudDeployCmd.Flags().String("ci-message", "", "Used to set the commit message for your deployment metadata") cloudDeployCmd.Flags().String("ci-git-provider", "", "Used to set the git provider for your deployment metadata") cloudDeployCmd.Flags().String("ci-logs-url", "", "Used to set the CI logs URL for your deployment metadata") + cloudDeployCmd.Flags().String("tag", "latest", "An tag for this deployment, defaults to 'latest'") + cloudDeployCmd.Flags().String("tag-message", "", "An optional message for the tag") + cloudDeployCmd.Flags().String("tag-description", "", "An optional description for the tag") cloudDeployCmd.Flags().MarkHidden("deploymentId") cloudDeployCmd.Flags().MarkHidden("ci") diff --git a/cmd/project.go b/cmd/project.go index b1ccd135..eebfb834 100644 --- a/cmd/project.go +++ b/cmd/project.go @@ -643,7 +643,7 @@ Examples: fmt.Println(tui.Bold(orgNames[orgId]) + " " + tui.Muted("("+orgId+")")) fmt.Println() - headers := []string{tui.Title("Project Id"), tui.Title("Name"), tui.Title("Description")} + headers := []string{tui.Title("Project Id"), tui.Title("Name"), tui.Title("Description"), tui.Title("Tag"), tui.Title("Tag Message")} rows := [][]string{} for _, project := range orgProjects[orgId] { desc := project.Description @@ -654,12 +654,14 @@ Examples: tui.Muted(project.ID), tui.Bold(project.Name), tui.Text(tui.MaxWidth(desc, 30)), + tui.Muted(project.Tag), + tui.Muted(project.TagMessage), }) } tui.Table(headers, rows) } } else { - headers := []string{tui.Title("Project Id"), tui.Title("Name"), tui.Title("Description")} + headers := []string{tui.Title("Project Id"), tui.Title("Name"), tui.Title("Description"), tui.Title("Tag"), tui.Title("Tag Message")} rows := [][]string{} for _, project := range projects { desc := project.Description @@ -670,6 +672,8 @@ Examples: tui.Muted(project.ID), tui.Bold(project.Name), tui.Text(tui.MaxWidth(desc, 30)), + tui.Muted(project.Tag), + tui.Muted(project.TagMessage), }) } tui.Table(headers, rows) diff --git a/internal/project/project.go b/internal/project/project.go index 7fa67eff..0173a78b 100644 --- a/internal/project/project.go +++ b/internal/project/project.go @@ -283,6 +283,8 @@ type ProjectListData struct { Description string `json:"description"` OrgId string `json:"orgId"` OrgName string `json:"orgName"` + Tag string `json:"tag"` + TagMessage string `json:"tagMessage"` } func ListProjects(ctx context.Context, logger logger.Logger, baseUrl string, token string) ([]ProjectListData, error) {