From 674372ad74f1857e352038a93a7e7edfced1fb60 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Thu, 30 Sep 2021 17:24:12 +0000 Subject: [PATCH] Make updating roles optional to help development --- deploy.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index bd72edc..2288ea6 100755 --- a/deploy.sh +++ b/deploy.sh @@ -2,12 +2,25 @@ set -eu +UPDATE=true +if [ $# -eq 1 ] && [ "$1" = "-n" ]; then + UPDATE=false + shift +fi + +if [ $# -gt 0 ]; then + echo "Usage: $(basename "$0") [-n]" 1>&2 + exit 1 +fi + # run sudo to cache creds sudo /bin/true # update modules and check depencies git pull -git submodule update --init --recursive +if "$UPDATE" || [ ! -f roles/.git ]; then + git submodule update --init --recursive +fi if ! rpm -q ansible > /dev/null; then sudo dnf -y install ansible fi