ci: actually error when we have errors
This commit is contained in:
parent
8bd9ead486
commit
76b9938c6e
30
bin/ci
30
bin/ci
@ -25,16 +25,34 @@ fi
|
||||
git pull || handle_pull_fail
|
||||
|
||||
if [ "${1}" = "update" ]; then
|
||||
git checkout -b "${ci_branch}" || handle_co_fail
|
||||
nix flake update --commit-lock-file || handle_update_fail
|
||||
nix flake check || handle_check_fail
|
||||
git checkout main || handle_co_fail
|
||||
git merge "${ci_branch}" || handle_merge_fail
|
||||
if ! git checkout -b "${ci_branch}"; then
|
||||
handle_co_fail
|
||||
exit 1
|
||||
fi
|
||||
if ! nix flake update --commit-lock-file; then
|
||||
handle_update_fail
|
||||
exit 1
|
||||
fi
|
||||
if ! nix flake check; then
|
||||
handle_check_fail
|
||||
exit 1
|
||||
fi
|
||||
if ! git checkout main; then
|
||||
handle_co_fail
|
||||
exit 1
|
||||
fi
|
||||
if ! git merge "${ci_branch}"; then
|
||||
handle_merge_fail
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Agent is configured to forget keys after X, if that happens we need to re-add before push
|
||||
agentHasKey "$(cat /run/secrets/ci_ed25519_pub | awk '{print $2}')" ||
|
||||
ssh-add /run/secrets/ci_ed25519_key
|
||||
git push || handle_push_fail
|
||||
if ! git push; then
|
||||
handle_push_fail
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
nix flake check || handle_check_fail
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user