Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
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
28 changes: 20 additions & 8 deletions cmd/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Examples:
install, _ := cmd.Flags().GetBool("install")
deploy, _ := cmd.Flags().GetBool("deploy")
ci, _ := cmd.Flags().GetBool("ci")
tag, _ := cmd.Flags().GetString("tag")
tags, _ := cmd.Flags().GetStringArray("tag")
description, _ := cmd.Flags().GetString("description")

if err := bundler.Bundle(bundler.BundleContext{
Expand Down Expand Up @@ -73,9 +73,17 @@ Examples:
if deploymentId != "" {
args = append(args, "--deploymentId", deploymentId)
}
if tag != "" {
args = append(args, "--tag", tag)
if len(tags) > 0 {
for _, tag := range tags {
args = append(args, "--tag", tag)
}
}

// if no tags are provided, set the latest tag
if len(tags) == 0 {
args = append(args, "--tag", "latest")
}

if description != "" {
args = append(args, "--description", description)
}
Expand All @@ -92,17 +100,25 @@ Examples:
"ci-logs-url",
"ci-git-provider",
"ci-logs-url",
"tag",
}

f := cmd.Flags()
for _, flag := range flags {
projectContext.Logger.Debug("flag: %s", flag)
if f.Changed(flag) {
switch f.Lookup(flag).Value.Type() {
case "string":
val, _ := f.GetString(flag)
args = append(args, "--"+flag, val)
case "bool":
args = append(args, "--"+flag)
case "stringArray":
val, _ := f.GetStringArray(flag)
for _, v := range val {
projectContext.Logger.Debug("v: %s", v)
args = append(args, "--"+flag, v)
}
}
}
}
Expand All @@ -111,10 +127,6 @@ Examples:
if ciMessage, _ := f.GetString("ci-message"); ciMessage != "" {
args = append(args, "--message", ciMessage)
}
if ciCommit, _ := f.GetString("ci-commit"); ciCommit != "" {
args = append(args, "--tag", ciCommit)
}
args = append(args, "--tag", "latest")
}

started = time.Now()
Expand Down Expand Up @@ -146,7 +158,7 @@ func init() {
bundleCmd.Flags().BoolP("install", "i", false, "Whether to install dependencies before bundling")
bundleCmd.Flags().Bool("deploy", false, "Whether to deploy after bundling")
bundleCmd.Flags().String("deploymentId", "", "Used to track a specific deployment")
bundleCmd.Flags().String("tag", "", "Used to set the tag of the deployment")
bundleCmd.Flags().StringArray("tag", nil, "Tag(s) to associate with this deployment (can be specified multiple times)")
bundleCmd.Flags().String("description", "", "Used to set the description of the deployment")
bundleCmd.Flags().MarkHidden("deploymentId")
bundleCmd.Flags().Bool("ci", false, "Used to track a specific CI job")
Expand Down
5 changes: 4 additions & 1 deletion cmd/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,17 @@ Examples:

// If no tags are provided, default to ["latest"]
if len(tags) == 0 {
logger.Debug("no tags provided, setting to latest")
tags = []string{"latest"}
}

if len(tags) != 0 && !slices.Contains(tags, "latest") {
if !slices.Contains(tags, "latest") {
logger.Debug("latest tag not found in tags array, setting preview to true")
preview = true
}

logger.Debug("preview: %v", preview)

deploymentConfig := project.NewDeploymentConfig()
client := util.NewAPIClient(ctx, logger, apiUrl, token)
var envFile *deployer.EnvFile
Expand Down
Loading