Skip to content
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
3 changes: 3 additions & 0 deletions .changes/unreleased/Feature-20250312-122543.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Feature
body: Add ability to set the status field of a deploy event
time: 2025-03-12T12:25:43.58387-05:00
7 changes: 7 additions & 0 deletions src/cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type DeployEvent struct {
DeployNumber string `json:"deploy_number,omitempty" yaml:"deploy-number"`
Commit Commit `json:"commit,omitempty"`
DedupID string `json:"dedup_id,omitempty" yaml:"dedup-id"`
Status string `json:"status,omitempty" yaml:"status"`
}

var deployCreateCmd = &cobra.Command{
Expand Down Expand Up @@ -116,6 +117,9 @@ func init() {
deployCreateCmd.Flags().StringP("description", "d", "", "description of the event (OPSLEVEL_DESCRIPTION)")
viper.BindEnv("description", "OPSLEVEL_DESCRIPTION", "OL_DESCRIPTION")

deployCreateCmd.Flags().String("status", "", "the status of the event, we accept any value but generally you should use one of ['queued','running','canceled','failure','success'] (OPSLEVEL_STATUS)")
viper.BindEnv("status", "OPSLEVEL_STATUS", "OL_STATUS")

deployCreateCmd.Flags().StringP("service", "s", "", "service alias for the event (OPSLEVEL_SERVICE)")
viper.BindEnv("service", "OPSLEVEL_SERVICE", "OL_SERVICE")

Expand Down Expand Up @@ -170,6 +174,9 @@ func fillWithOverrides(evt *DeployEvent) {
if message := viper.GetString("commit-message"); message != "" {
evt.Commit.Message = message
}
if status := viper.GetString("status"); status != "" {
evt.Status = status
}
}

func fillGitInfo(evt *DeployEvent) {
Expand Down
Loading