Make ship pier dir configurable in remote deployment script

This commit is contained in:
Prathamesh Musale 2023-12-05 12:41:03 +05:30
parent f09d13cc2a
commit 37a1b21fcd
2 changed files with 8 additions and 6 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
# $1: Glob file URL (eg. https://xyz.com/glob-abcd.glob)
# $2: Uniswap desk dir (default: ./zod/uniswap)
# $2: Urbit ship's pier dir (default: ./zod)
if [ -z "$1" ]; then
echo "Glob file URL arg not provided"
@ -13,8 +13,10 @@ glob_file=$(basename "$glob_url")
glob_hash=$(echo "$glob_file" | sed "s/glob-\([a-z0-9\.]*\).glob/\1/")
echo "Using glob file ${glob_file}"
# Default pier dir: ./zod
# Default desk dir: ./zod/uniswap
uniswap_desk_dir="${2:-./zod/uniswap}"
pier_dir="${2:-./zod}"
uniswap_desk_dir="${pier_dir}/uniswap"
echo "Using ${uniswap_desk_dir} as the Uniswap desk dir path"

View File

@ -1,18 +1,18 @@
#!/bin/bash
# $1: Remote user host
# $2: Path to run the app installation in (where urbit ship dir is located)
# $2: Remote Urbit ship's pier dir path (eg. /home/user/zod)
# $3: Glob file URL (eg. https://xyz.com/glob-abcd.glob)
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <username@remote_host> </path/to/remote/folder> <glob_url>"
echo "Usage: $0 <username@remote_host> </path/to/remote/pier/folder> <glob_url>"
exit 1
fi
remote_user_host="$1"
remote_folder="$2"
remote_pier_folder="$2"
glob_url="$3"
installation_script="./install-uniswap-app.sh"
ssh "$remote_user_host" "cd $remote_folder && bash -s $glob_url" < "$installation_script"
ssh "$remote_user_host" "bash -s $glob_url $remote_pier_folder" < "$installation_script"