mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
refactor(ci): scripts
This commit is contained in:
parent
c4fcb16fef
commit
5c73439cad
19 changed files with 288 additions and 207 deletions
21
ci/sshopts.sh
Normal file
21
ci/sshopts.sh
Normal 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[*]}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue