From 6383cce853b595b78eb686984b6e17c690f09751 Mon Sep 17 00:00:00 2001 From: William Luke Date: Wed, 26 Jan 2022 11:16:41 +0300 Subject: [PATCH] Add install oneliner and rsync --- install.sh | 32 ++++++++++++++++++++++++++++++++ rsync-install-script.sh | 9 +++++++++ 2 files changed, 41 insertions(+) create mode 100644 install.sh create mode 100644 rsync-install-script.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..b79b08f --- /dev/null +++ b/install.sh @@ -0,0 +1,32 @@ +# Example Usage +# bash <(curl -s https://pip.grassrootseconomics.net/cic-staff-installer.sh) -h +# This is currently living on at pip because root is using a self signed cert +# When changes are made to this file you must run bash ./rsync-install-script.sh to sync it to the server + +branch='master' +verbose='false' + +print_usage() { + printf "CIC Staff Installer + Options: + -b Name of the branch you want use to install + -v Verbose + -h Print this help message +" +} + +while getopts 'hb:v' flag; do + case "${flag}" in + b) branch="${OPTARG}" ;; + v) verbose='true' ;; + h) print_usage + exit 0 ;; + *) print_usage + exit 1 ;; + esac +done + +temp_dir=`mktemp -d` +git clone -b $branch https://git.grassecon.net/grassrootseconomics/cic-staff-installer.git $temp_dir +cd $temp_dir +bash setup.sh \ No newline at end of file diff --git a/rsync-install-script.sh b/rsync-install-script.sh new file mode 100644 index 0000000..f17a36e --- /dev/null +++ b/rsync-install-script.sh @@ -0,0 +1,9 @@ +host='root.grassrootseconomics.net' +file_to_sync='./install.sh' +distination_dir='/usr/local/share/python/packages' +distination_file_name='cic-staff-installer.sh' +user='root' + +echo Syncing $file_to_sync to $distination_dir as $user on $host + +rsync -avz --progress $file_to_sync $user@$host:$distination_dir/$distination_file_name