ci: alert on failed input updates but continue updating other inputs

This commit is contained in:
Aaron Bieber 2023-05-09 18:31:04 -06:00
parent e05a5cd12f
commit f2bd8ec6d4
No known key found for this signature in database
2 changed files with 10 additions and 5 deletions

9
bin/ci
View File

@ -31,10 +31,11 @@ if [ "${1}" = "update" ]; then
handle_co_fail
exit 1
fi
if ! nix flake update --commit-lock-file; then
handle_update_fail
exit 1
fi
for inp in $(nix flake metadata --json | jq -r '.locks.nodes.root.inputs | keys[] as $k | $k'); do
if ! nix flake lock --commit-lock-file --update-input "$inp"; then
handle_update_fail $inp
fi
done
if ! nix flake check --print-build-logs; then
handle_update_check_fail
exit 1

View File

@ -87,6 +87,10 @@ ci_error() {
git checkout main
}
_po() {
po -title "$1" -body "$2"
}
po_error() {
po -title "$1" -body "$2"
ci_error
@ -122,7 +126,7 @@ handle_co_fail() {
}
handle_update_fail() {
po_error "CI: flake input update failed!" "$(get_journal xin-ci-update)"
_po "CI: input '$1' update failed!" "$(get_journal xin-ci-update)"
}
handle_check_fail() {