2
0
Эх сурвалжийг харах

don't notify on successful job deployments

Alexander Belanger 4 жил өмнө
parent
commit
09e3a02f96

+ 5 - 3
api/server/handlers/release/ugprade.go

@@ -167,10 +167,12 @@ func (c *UpgradeReleaseHandler) ServeHTTP(w http.ResponseWriter, r *http.Request
 		return
 	}
 
-	notifyOpts.Status = slack.StatusHelmDeployed
-	notifyOpts.Version = helmRelease.Version
+	if helmRelease.Chart != nil && helmRelease.Chart.Metadata.Name != "job" {
+		notifyOpts.Status = slack.StatusHelmDeployed
+		notifyOpts.Version = helmRelease.Version
 
-	notifier.Notify(notifyOpts)
+		notifier.Notify(notifyOpts)
+	}
 
 	// update the github actions env if the release exists and is built from source
 	if cName := helmRelease.Chart.Metadata.Name; cName == "job" || cName == "web" || cName == "worker" {

+ 5 - 3
api/server/handlers/release/upgrade_webhook.go

@@ -182,10 +182,12 @@ func (c *WebhookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
-	notifyOpts.Status = slack.StatusHelmDeployed
-	notifyOpts.Version = rel.Version
+	if rel.Chart != nil && rel.Chart.Metadata.Name != "job" {
+		notifyOpts.Status = slack.StatusHelmDeployed
+		notifyOpts.Version = rel.Version
 
-	notifier.Notify(notifyOpts)
+		notifier.Notify(notifyOpts)
+	}
 
 	c.Config().AnalyticsClient.Track(analytics.ApplicationDeploymentWebhookTrack(&analytics.ApplicationDeploymentWebhookTrackOpts{
 		ImageURI: fmt.Sprintf("%v", repository),