Update remote deployment script to accept glob hash arg
This commit is contained in:
parent
37a1b21fcd
commit
2969cce48b
@ -1,23 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# $1: Glob file URL (eg. https://xyz.com/glob-abcd.glob)
|
# $1: Glob file URL (eg. https://xyz.com/glob-0vabcd.glob)
|
||||||
# $2: Urbit ship's pier dir (default: ./zod)
|
# $2: Glob file hash (eg. 0vabcd)
|
||||||
|
# $3: Urbit ship's pier dir (default: ./zod)
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ "$#" -lt 2 ]; then
|
||||||
echo "Glob file URL arg not provided"
|
echo "Insufficient arguments"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
glob_url=$1
|
glob_url=$1
|
||||||
glob_file=$(basename "$glob_url")
|
glob_hash=$2
|
||||||
glob_hash=$(echo "$glob_file" | sed "s/glob-\([a-z0-9\.]*\).glob/\1/")
|
echo "Using glob file from ${glob_url} with hash ${glob_hash}"
|
||||||
echo "Using glob file ${glob_file}"
|
|
||||||
|
|
||||||
# Default pier dir: ./zod
|
# Default pier dir: ./zod
|
||||||
# Default desk dir: ./zod/uniswap
|
# Default desk dir: ./zod/uniswap
|
||||||
pier_dir="${2:-./zod}"
|
pier_dir="${3:-./zod}"
|
||||||
uniswap_desk_dir="${pier_dir}/uniswap"
|
uniswap_desk_dir="${pier_dir}/uniswap"
|
||||||
|
|
||||||
echo "Using ${uniswap_desk_dir} as the Uniswap desk dir path"
|
echo "Using ${uniswap_desk_dir} as the Uniswap desk dir path"
|
||||||
|
|
||||||
# Fire curl requests to perform operations on the ship
|
# Fire curl requests to perform operations on the ship
|
||||||
|
@ -2,17 +2,20 @@
|
|||||||
|
|
||||||
# $1: Remote user host
|
# $1: Remote user host
|
||||||
# $2: Remote Urbit ship's pier dir path (eg. /home/user/zod)
|
# $2: Remote Urbit ship's pier dir path (eg. /home/user/zod)
|
||||||
# $3: Glob file URL (eg. https://xyz.com/glob-abcd.glob)
|
# $3: Glob file URL (eg. https://xyz.com/glob-0vabcd.glob)
|
||||||
|
# $4: Glob file hash (eg. 0vabcd)
|
||||||
|
|
||||||
if [ "$#" -ne 3 ]; then
|
if [ "$#" -ne 4 ]; then
|
||||||
echo "Usage: $0 <username@remote_host> </path/to/remote/pier/folder> <glob_url>"
|
echo "Incorrect number of arguments"
|
||||||
|
echo "Usage: $0 <username@remote_host> </path/to/remote/pier/folder> <glob_url> <glob_hash>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
remote_user_host="$1"
|
remote_user_host="$1"
|
||||||
remote_pier_folder="$2"
|
remote_pier_folder="$2"
|
||||||
glob_url="$3"
|
glob_url="$3"
|
||||||
|
glob_hash="$4"
|
||||||
|
|
||||||
installation_script="./install-uniswap-app.sh"
|
installation_script="./install-uniswap-app.sh"
|
||||||
|
|
||||||
ssh "$remote_user_host" "bash -s $glob_url $remote_pier_folder" < "$installation_script"
|
ssh "$remote_user_host" "bash -s $glob_url $glob_hash $remote_pier_folder" < "$installation_script"
|
||||||
|
Loading…
Reference in New Issue
Block a user