From 8094529d53819b2afaeb6ee33c4fd39ab1ea1c75 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Sun, 29 Jan 2023 08:52:54 -0700 Subject: [PATCH] ci: call ci from ci --- ci | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/ci b/ci index bd05667..455cc0a 100755 --- a/ci +++ b/ci @@ -13,22 +13,24 @@ else tmux -2 new-session -d ${SESS} fi -tmux -2 attach-session -t "$NAME" +tmux -2 attach-session -t "$NAME" "./ci run" trap ci_error INT TERM -ci_branch=$(date +"%Y%m%dT%H%M%S%z") -can_sign=0 +if [ "$1" = "run" ]; then + ci_branch=$(date +"%Y%m%dT%H%M%S%z") + can_sign=0 -for i in $(ssh-add -L | awk '{print $NF}'); do - grep -q $i .allowed_signers && can_sign=1 -done + for i in $(ssh-add -L | awk '{print $NF}'); do + grep -q $i .allowed_signers && can_sign=1 + done -if [ $can_sign != 1 ]; then - echo "Can't find signing key." - exit 1 + if [ $can_sign != 1 ]; then + echo "Can't find signing key." + exit 1 + fi + + git checkout -b "${ci_branch}" || handle_co_fail + nix flake update --commit-lock-file || handle_update_fail + nix flake check || handle_check_fail fi - -git checkout -b "${ci_branch}" || handle_co_fail -nix flake update --commit-lock-file || handle_update_fail -nix flake check || handle_check_fail