refactor(ci): scripts

This commit is contained in:
arcnmx 2024-02-22 11:46:52 -08:00
parent c4fcb16fef
commit 5c73439cad
19 changed files with 288 additions and 207 deletions

21
ci/sshopts.sh Normal file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -eu
ARG_HOSTNAME=$1
ARG_NODE=${ARG_HOSTNAME%%.*}
if DEPLOY_SSHOPTS=$(nix eval --json "${NF_CONFIG_ROOT}#deploy.nodes.$ARG_HOSTNAME.sshOpts" 2>/dev/null); then
SSHOPTS=($(jq -r '.[]' <<<"$DEPLOY_SSHOPTS"))
echo "${SSHOPTS[*]}"
elif [[ $ARG_NODE = reisen ]]; then
SSHOPTS=()
else
SSHOPTS=(${NIX_SSHOPTS--p62954})
fi
if [[ $ARG_NODE = ct || $ARG_NODE = reisen-ct ]]; then
SSHOPTS+=(-oUpdateHostKeys=no -oStrictHostKeyChecking=off)
else
SSHOPTS+=(-oHostKeyAlias=$ARG_NODE.gensokyo.zone)
fi
echo "${SSHOPTS[*]}"