this repo has no description
4
fork

Configure Feed

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

fix(deploy): only git push if any inputs were updated

dusk 4a993cf9 d8587baf

+10 -5
+10 -5
deploy.nu
··· 100 100 return 101 101 } 102 102 103 - try { git push } 104 103 webhook $hooktitle $"=== deploy for ($hostname): finished ===" 0 true 105 104 } 106 105 107 - def update-inputs [inputs: list<string>] { 108 - let inputsText = $inputs | str join ", " 106 + def update-inputs []: list<string> -> bool { 107 + let inputsText = $in | str join ", " 109 108 let stashed = try { 110 109 let stash_result = git stash | complete 111 110 $stash_result.stdout | str contains "Saved working directory" ··· 113 112 false 114 113 } 115 114 log info $"trying to update inputs ($inputsText)" 116 - let result = nix run .#nvfetcher -- -f $"\(($inputs | str join '|')\)" | complete 115 + let result = nix run .#nvfetcher -- -f $"\(($in | str join '|')\)" | complete 117 116 let is_ok = ($result.stdout | str contains "Changes:") 118 117 if $is_ok { 119 118 let changes_content = $result.stdout | lines | skip until {|line| $line | str contains "Changes:"} | skip 1 | str join "\n" ··· 135 134 git stash pop 136 135 } 137 136 } 137 + $is_ok 138 138 } 139 139 140 140 def main [hostname: string = "wolumonde", --only-deploy (-d)] { 141 141 webhook "deploy" "=== started deploying ===" 142 142 143 + mut inputs_updated = false 143 144 if $only_deploy == false { 144 - update-inputs ["blog" "limbusart" "nsid-tracker" "tangled" "headplane"] 145 + $inputs_updated = ["blog" "limbusart" "nsid-tracker" "tangled" "headplane"] | update-inputs 145 146 try { 146 147 log info "trying to update dns records" 147 148 nix run ".#dns" -- push ··· 151 152 } 152 153 153 154 deploy $hostname 155 + 156 + if $inputs_updated { 157 + try { git push } 158 + } 154 159 }