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
23
ci/switch.sh
Normal file
23
ci/switch.sh
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
ARG_NODE=$1
|
||||
shift
|
||||
ARG_HOSTNAME=$(nf-hostname "$ARG_NODE")
|
||||
NIX_SSHOPTS=$(nf-sshopts "$ARG_NODE")
|
||||
|
||||
if [[ $# -gt 0 ]]; then
|
||||
ARG_METHOD=$1
|
||||
shift
|
||||
else
|
||||
ARG_METHOD=switch
|
||||
fi
|
||||
|
||||
if [[ $ARG_HOSTNAME != root@ ]]; then
|
||||
set -- --use-remote-sudo "$@"
|
||||
fi
|
||||
|
||||
exec nixos-rebuild "$ARG_METHOD" \
|
||||
--flake "${NF_CONFIG_ROOT}#${ARG_NODE}" \
|
||||
--no-build-nix \
|
||||
--target-host "$ARG_HOSTNAME" \
|
||||
"$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue