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
8 changes: 6 additions & 2 deletions cmd/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ Examples:
"ci-branch",
"ci-commit",
"ci-messsage",
"ci-git-provider"}
"ci-logs-url",
"ci-git-provider",
"ci-logs-url",
}

f := cmd.Flags()
for _, flag := range flags {
Expand Down Expand Up @@ -131,11 +134,12 @@ func init() {
bundleCmd.Flags().String("ci-commit", "", "Used to set the commit hash for your deployment metadata")
bundleCmd.Flags().String("ci-message", "", "Used to set the commit message for your deployment metadata")
bundleCmd.Flags().String("ci-git-provider", "", "Used to set the git provider for your deployment metadata")
bundleCmd.Flags().String("ci-logs-url", "", "Used to set the CI logs URL for your deployment metadata")

bundleCmd.Flags().MarkHidden("ci-remote-url")
bundleCmd.Flags().MarkHidden("ci-branch")
bundleCmd.Flags().MarkHidden("ci-commit")
bundleCmd.Flags().MarkHidden("ci-messsage")
bundleCmd.Flags().MarkHidden("ci-git-provider")

bundleCmd.Flags().MarkHidden("ci-logs-url")
}
21 changes: 16 additions & 5 deletions cmd/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ Examples:
ciCommit, _ := cmd.Flags().GetString("ci-commit")
ciMessage, _ := cmd.Flags().GetString("ci-message")
ciGitProvider, _ := cmd.Flags().GetString("ci-git-provider")
ciLogsUrl, _ := cmd.Flags().GetString("ci-logs-url")

deploymentConfig := project.NewDeploymentConfig()
client := util.NewAPIClient(ctx, logger, apiUrl, token)
Expand Down Expand Up @@ -360,9 +361,13 @@ Examples:

var gitInfo deployer.GitInfo
var originType string
isOverwritingGitInfo := ciRemoteUrl != "" || ciBranch != "" || ciCommit != "" || ciMessage != "" || ciGitProvider != ""
var ciInfo deployer.CIInfo
isOverwritingGitInfo := ciRemoteUrl != "" || ciBranch != "" || ciCommit != "" || ciMessage != "" || ciGitProvider != "" || ciLogsUrl != ""
if ci && isOverwritingGitInfo {
originType = "ci"
ciInfo = deployer.CIInfo{
LogsURL: ciLogsUrl,
}
gitInfo = deployer.GitInfo{
RemoteURL: &ciRemoteUrl,
Branch: &ciBranch,
Expand All @@ -380,13 +385,17 @@ Examples:
originType = "cli"
}

data := map[string]interface{}{
"machine": deployer.GetMachineInfo(),
"git": gitInfo,
}
if originType == "ci" && ciLogsUrl != "" {
data["ci"] = ciInfo
}
startRequest.Metadata = &deployer.Metadata{
Origin: deployer.MetadataOrigin{
Type: originType,
Data: map[string]interface{}{
"machine": deployer.GetMachineInfo(),
"git": gitInfo,
},
Data: data,
},
}

Expand Down Expand Up @@ -653,6 +662,7 @@ func init() {
cloudDeployCmd.Flags().String("ci-commit", "", "Used to set the commit hash for your deployment metadata")
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().MarkHidden("deploymentId")
cloudDeployCmd.Flags().MarkHidden("ci")
Expand All @@ -661,6 +671,7 @@ func init() {
cloudDeployCmd.Flags().MarkHidden("ci-commit")
cloudDeployCmd.Flags().MarkHidden("ci-messsage")
cloudDeployCmd.Flags().MarkHidden("ci-git-provider")
cloudDeployCmd.Flags().MarkHidden("ci-logs-url")

cloudDeployCmd.Flags().String("format", "text", "The output format to use for results which can be either 'text' or 'json'")
cloudDeployCmd.Flags().String("org-id", "", "The organization to create the project in")
Expand Down
4 changes: 4 additions & 0 deletions internal/deployer/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import (
"github.com/go-git/go-git/v5"
)

type CIInfo struct {
LogsURL string `json:"logsUrl"`
}

// GitInfo contains basic git repository information
type GitInfo struct {
RemoteURL *string `json:"remoteUrl"`
Expand Down
Loading