Skip to content

Commit

Permalink
Log failed health check to discord _before_ exiting
Browse files Browse the repository at this point in the history
  • Loading branch information
plexus committed Jul 20, 2024
1 parent 3af7c3d commit 272c0c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ops/pre-receive.bb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'[cheshire.core :as json]
'[babashka.curl :as curl])

(def timeout 120)
(def timeout 90)
(def service-name "compass")
(def health-check-url "http://localhost:8080/health")
(def app-dir "/home/compass/app")
Expand Down Expand Up @@ -155,14 +155,14 @@
(println (color 33 "Health check failed, reverting"))
(sh "ln" "-sf" old-link current-dir)
(systemctl "restart")
(fatal "Health check failed")
(notify-discord
(str "> __**Deployment health check failed, reverted.**__\n"
"> ```\n"
(->> (str/split log-lines #"\R")
(map #(str "> " %))
(str/join "\n"))
"> ```")))
"> ```"))
(fatal "Health check failed"))
(do
(notify-discord
(str "> __**Deployed " sha "**__\n"
Expand Down

0 comments on commit 272c0c9

Please sign in to comment.