helm/deploy
Henrik Lissner 589c1c04a1
Bring back deploy script for remote bootstrap
And make linode config a regular module.
2020-01-13 19:56:39 -05:00

30 lines
621 B
Plaintext

#!/usr/bin/env nix-shell
#! nix-shell -i bash -p git gnumake
set -e # bail if an error occurs
if [ $EUID -nq 0 ]; then
>&2 echo "Must be run as root"
exit 1
fi
USER=${USER:-hlissner}
HOST=${1:-${HOST:-kuro}}
DOTFILES="/home/$USER/.dotfiles"
if [ ! -d /etc/dotfiles ]; then
git clone https://github.com/hlissner/dotfiles "$DOTFILES"
chown -R $USER:users "$DOTFILES"
fi
ln -sf "$DOTFILES" /etc/dotfiles
if [ ! -f "$DOTFILES/machines/$HOST.nix" ]; then
>&2 echo "No configuration exists for host '$HOST'"
exit 1
fi
if [ -n "$LINODE" ]; then
ARGS="\"$HOST\""
HOST=linode
fi
make -C "$DOTFILES" install