feat(deploy): founder push notifications on deploys [#734]
Also first live E2E of the gitea webhook: this push triggers the pull + reload_all path with no core restart. Detail: https://projects.knownelement.com/issues/734
This commit is contained in:
+30
-6
@@ -224,7 +224,6 @@
|
||||
title: TEMP RISING FAST
|
||||
message: '{{ trigger.entity_id }} climbing ~10F/15min — check cooling
|
||||
before the 104F threshold. (rate-of-change early warning)'
|
||||
mode: single
|
||||
# Deploy pipeline [#734]: gitea repo webhook (master pushes) -> forced pull
|
||||
# -> minimal reload. Core restarts ONLY when configuration.yaml or a
|
||||
# packages platform-sensor file changed; everything else reloads with no
|
||||
@@ -258,13 +257,22 @@
|
||||
+ (trigger.json.commits | default([]) | map(attribute='modified') | flatten | list) }}
|
||||
need_restart: >-
|
||||
{{ changed_files | select('in', ['configuration.yaml', 'packages/plant_snmp.yaml']) | list | count > 0 }}
|
||||
push_message: >-
|
||||
Git push ({{ trigger.json.sender.login | default('unknown') }}):
|
||||
{{ trigger.json.commits | default([]) | map(attribute='message') | join(' | ') | truncate(120) }}.
|
||||
{{ 'Core restart required' if need_restart else 'Reload only - no core restart' }}.
|
||||
- action: persistent_notification.create
|
||||
data:
|
||||
title: Deploy started
|
||||
message: >-
|
||||
Git push ({{ trigger.json.sender.login | default('unknown') }}):
|
||||
{{ trigger.json.commits | default([]) | map(attribute='message') | join(' | ') | truncate(160) }}.
|
||||
Pulling now - {{ 'core restart required' if need_restart else 'reload only, no restart' }}.
|
||||
message: "{{ push_message }} Pulling now."
|
||||
- action: notify.send_message
|
||||
target:
|
||||
entity_id:
|
||||
- notify.ultix_sidecar_new
|
||||
- notify.allthes_ipad
|
||||
data:
|
||||
title: PFV deploy started
|
||||
message: "{{ push_message }}"
|
||||
- action: hassio.addon_restart
|
||||
data:
|
||||
addon: core_git_pull
|
||||
@@ -280,6 +288,14 @@
|
||||
data:
|
||||
title: Deploy - restarting core
|
||||
message: "Pull done; restarting core for {{ changed_files | join(', ') }}. Back in ~1 min."
|
||||
- action: notify.send_message
|
||||
target:
|
||||
entity_id:
|
||||
- notify.ultix_sidecar_new
|
||||
- notify.allthes_ipad
|
||||
data:
|
||||
title: PFV deploy - core restarting
|
||||
message: "Pull done; restarting core for {{ changed_files | join(', ') }}."
|
||||
- delay:
|
||||
hours: 0
|
||||
minutes: 0
|
||||
@@ -290,4 +306,12 @@
|
||||
- action: persistent_notification.create
|
||||
data:
|
||||
title: Deploy complete
|
||||
message: "Pulled + reloaded YAML config at {{ now().strftime('%H:%M:%S') }} (no core restart). Files: {{ changed_files | join(', ') | truncate(200) }}"
|
||||
message: "Pulled + reloaded YAML config at {{ now().strftime('%H:%M:%S') }} (no core restart). Files: {{ changed_files | join(', ') | truncate(180) }}"
|
||||
- action: notify.send_message
|
||||
target:
|
||||
entity_id:
|
||||
- notify.ultix_sidecar_new
|
||||
- notify.allthes_ipad
|
||||
data:
|
||||
title: PFV deploy complete
|
||||
message: "Pulled + reloaded YAML at {{ now().strftime('%H:%M:%S') }} - no core restart. Files: {{ changed_files | join(', ') | truncate(120) }}"
|
||||
|
||||
Reference in New Issue
Block a user