From 2f9c9e43de61f0a0acb75c66e962ef7dd53cf88c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 19 Oct 2023 19:22:53 +0200 Subject: [PATCH] add sync script for runa git repo --- bin/sync-to-runa.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 bin/sync-to-runa.sh diff --git a/bin/sync-to-runa.sh b/bin/sync-to-runa.sh new file mode 100755 index 0000000..9c22a4a --- /dev/null +++ b/bin/sync-to-runa.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +if [ ! -d ansible -o ! -f bin/sync-to-runa.sh ]; then + echo "Need to run from project root" + exit 1 +fi + +if [ $# -lt 2 ]; then + echo $0 runa-git-repo git-commit-message + exit 1 +fi + +dest=$1; shift + +rsync -avn --delete ansible $dest + +read -p "All good?" + +rsync -av --delete ansible $dest +cd $dest && git add . && git commit -m "$@" && git push