deploy: simplify host check stuff and allow BUILD_HOST to be set
This commit is contained in:
parent
0bdcfc6638
commit
87b8e0d9ad
21
bin/deploy
21
bin/deploy
@ -12,24 +12,9 @@ rebuild() {
|
||||
|
||||
msg "Rebuilding: ${host}"
|
||||
|
||||
if ! tsAlive $host; then
|
||||
msg "can't reach ${1}.. skipping.."
|
||||
return
|
||||
else
|
||||
host="${host}.otter-alligator.ts.net"
|
||||
fi
|
||||
|
||||
hostVersion=$(${SSH} root@${host} 'nixos-version --json | jq -r .configurationRevision')
|
||||
if [ $? != 0 ]; then
|
||||
return $?
|
||||
fi
|
||||
|
||||
if [ "$hostVersion" = "$CurrentVersion" ] && [ $skip_check = false ]; then
|
||||
msg "Up-to-date: ${host}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
nixos-rebuild ${TRACE} --flake .#${1} --build-host root@${host} --target-host root@${host} switch 2>&1 | nom
|
||||
set -x
|
||||
build_host=${BUILD_HOST:-$host}
|
||||
nixos-rebuild ${TRACE} --flake .#${1} --build-host "root@${build_host}" --target-host "root@${host}" switch 2>&1 | nom
|
||||
return $?
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user