this repo has no description
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(deploy): add some printing to debug with

dusk aafae8df 7c4d4c9e

+9
+9
deploy.nu
··· 7 7 # load webhook secrets 8 8 rage -d -i ./ssh_key ./secrets/deployWebhook.age | from toml | load-env 9 9 10 + def log [msg: string, --type (-t): string = "info"] { 11 + print $"[($type)][(date now | format date "%H:%M:%S")] ($msg)" 12 + } 13 + 10 14 def webhook [title: string, content: string, exit_code?: number, ping?: bool = false] { 11 15 let type = if $exit_code == null { "⌛" } else if $exit_code == 0 { "✔️" } else { "❌" } 12 16 let msg = { ··· 19 23 } 20 24 }] 21 25 } 26 + 27 + log -t debug "posting webhook...." 22 28 http post --content-type application/json $"https://discord.com/api/webhooks/($env.WEBHOOK_ID)/($env.WEBHOOK_TOKEN)" $msg 23 29 } 24 30 25 31 def deploy [hostname: string] { 32 + log $"trying to deploy host ($hostname)" 26 33 let hooktitle = $"/($hostname)/deploy" 27 34 28 35 let start = date now ··· 36 43 } 37 44 38 45 def update-input [input: string] { 46 + log $"trying to update input ($input)" 39 47 let result = nix flake update $input | complete 40 48 let is_ok = ($result.stderr | str contains "Updated input") 41 49 let is_err = ($result.exit_code != 0) ··· 59 67 update-input "blog" 60 68 61 69 try { 70 + log "trying to update dns records" 62 71 nix run ".#dns" -- push 63 72 } catch { |err| 64 73 webhook "dns" $"=== error pushing dns ===\n\n($err.msg | to text)" 1