Skip to content

Commit 6618d17

Browse files
authored
Add deploy status (#380)
1 parent 11737a4 commit 6618d17

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Feature
2+
body: Add ability to set the status field of a deploy event
3+
time: 2025-03-12T12:25:43.58387-05:00

src/cmd/deploy.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ type DeployEvent struct {
4343
DeployNumber string `json:"deploy_number,omitempty" yaml:"deploy-number"`
4444
Commit Commit `json:"commit,omitempty"`
4545
DedupID string `json:"dedup_id,omitempty" yaml:"dedup-id"`
46+
Status string `json:"status,omitempty" yaml:"status"`
4647
}
4748

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

120+
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)")
121+
viper.BindEnv("status", "OPSLEVEL_STATUS", "OL_STATUS")
122+
119123
deployCreateCmd.Flags().StringP("service", "s", "", "service alias for the event (OPSLEVEL_SERVICE)")
120124
viper.BindEnv("service", "OPSLEVEL_SERVICE", "OL_SERVICE")
121125

@@ -170,6 +174,9 @@ func fillWithOverrides(evt *DeployEvent) {
170174
if message := viper.GetString("commit-message"); message != "" {
171175
evt.Commit.Message = message
172176
}
177+
if status := viper.GetString("status"); status != "" {
178+
evt.Status = status
179+
}
173180
}
174181

175182
func fillGitInfo(evt *DeployEvent) {

0 commit comments

Comments
 (0)