Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Merged
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
39 changes: 37 additions & 2 deletions cmd/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,14 @@ and starts the deployment process. It will reconcile any differences
between local and remote agents.

Flags:
--dir The directory containing the project to deploy
--dir The directory containing the project to deploy
--dry-run Save deployment zip file to specified directory instead of uploading

Examples:
agentuity cloud deploy
agentuity deploy
agentuity cloud deploy --dir /path/to/project`,
agentuity cloud deploy --dir /path/to/project
agentuity deploy --dry-run ./output`,
Run: func(cmd *cobra.Command, args []string) {
parentCtx := context.Background()
ctx, cancel := signal.NotifyContext(parentCtx, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
Expand All @@ -195,6 +197,7 @@ Examples:
tags, _ := cmd.Flags().GetStringArray("tag")
description, _ := cmd.Flags().GetString("description")
message, _ := cmd.Flags().GetString("message")
dryRun, _ := cmd.Flags().GetString("dry-run")
Comment thread
robindiddams marked this conversation as resolved.

// remove duplicates and empty strings
tags = util.RemoveDuplicates(tags)
Expand Down Expand Up @@ -535,6 +538,37 @@ Examples:

tui.ShowSpinner("Packaging ...", zipaction)

if dryRun != "" {

// Validate and create the dryRun directory if it doesn't exist
if !util.Exists(dryRun) {
if err := os.MkdirAll(dryRun, 0755); err != nil {
errsystem.New(errsystem.ErrCreateZipFile, err,
errsystem.WithContextMessage(fmt.Sprintf("Error creating dry run directory '%s': %v", dryRun, err))).ShowErrorAndExit()
}
}

outputFile := filepath.Join(dryRun, fmt.Sprintf("agentuity-deploy-%s.zip", theproject.ProjectId))

if _, err := util.CopyFile(tmpfile.Name(), outputFile); err != nil {
errsystem.New(errsystem.ErrCreateZipFile, err,
errsystem.WithContextMessage("Error copying deployment zip file")).ShowErrorAndExit()
}

format, _ := cmd.Flags().GetString("format")
if format == "json" {
result := map[string]interface{}{
"dry_run": true,
"zip_file": outputFile,
"project_id": theproject.ProjectId,
}
json.NewEncoder(os.Stdout).Encode(result)
} else {
tui.ShowSuccess("Deployment zip saved to: %s", outputFile)
}
return
}

dof, err := os.Open(tmpfile.Name())
if err != nil {
errsystem.New(errsystem.ErrOpenFile, err,
Expand Down Expand Up @@ -972,6 +1006,7 @@ func init() {
cloudDeployCmd.Flags().String("description", "", "Description for the deployment")
cloudDeployCmd.Flags().String("message", "", "A shorter description for the deployment")
cloudDeployCmd.Flags().Bool("force", false, "Force the processing of environment files")
cloudDeployCmd.Flags().String("dry-run", "", "Save deployment zip file to specified directory (defaults to current directory) instead of uploading")
Comment thread
robindiddams marked this conversation as resolved.

cloudDeployCmd.Flags().MarkHidden("deploymentId")
cloudDeployCmd.Flags().MarkHidden("ci")
Expand Down
Loading