Improve deploy script
This commit is contained in:
parent
389b2a2e07
commit
386523641b
19
deploy.sh
19
deploy.sh
@ -3,8 +3,25 @@
|
||||
DEPLOY_HOST=$1
|
||||
DEPLOY_ADDRESS=$2
|
||||
|
||||
if [ -z $DEPLOY_HOST ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cmd=" \
|
||||
nixos-rebuild switch \
|
||||
-I nixos-config=hosts/${DEPLOY_HOST}/configuration.nix \
|
||||
"
|
||||
|
||||
if [ -z $DEPLOY_ADDRESS ]; then
|
||||
DEPLOY_ADDRESS="clerie@${DEPLOY_HOST}.net.clerie.de"
|
||||
fi
|
||||
|
||||
if [ $DEPLOY_ADDRESS != "localhost" ]; then
|
||||
cmd="${cmd} \
|
||||
--target-host ${DEPLOY_ADDRESS} \
|
||||
--build-host localhost \
|
||||
--use-remote-sudo
|
||||
--use-remote-sudo \
|
||||
"
|
||||
fi
|
||||
|
||||
eval ${cmd}
|
||||
|
Loading…
Reference in New Issue
Block a user