Skip to content
Snippets Groups Projects
update-deployment 717 B
Newer Older
GRIDNAME=$1
shift

if [ "${GRIDNAME}" = "local" ]; then
    BRANCH="323.continuous-deployment"
else
    BRANCH="${GRIDNAME}"
fi

CHECKOUT="/run/user/$(id --user)/PrivateStorageio"
REPO="https://whetstone.privatestorage.io/privatestorage/PrivateStorageio.git"

if [ -e "${CHECKOUT}" ]; then
    git -C "${CHECKOUT}" pull
else
    git clone "${REPO}" "${CHECKOUT}"
    # Check out the right branch ... which also happens to be named after this
    # grid (or maybe this grid is named after the branch).
    git -C "${CHECKOUT}" checkout "${BRANCH}"
fi

morph deploy "${CHECKOUT}"/morph/grid/"${GRIDNAME}"/grid.nix switch --on "$(hostname)"