mirror of
https://github.com/d0zingcat/deploy.git
synced 2026-06-06 15:10:52 +00:00
(fix) apply recent gateway changes to gateway-create bash script
This commit is contained in:
@@ -36,6 +36,7 @@ elif [[ ${FOLDER::1} != "/" ]]; then
|
|||||||
fi
|
fi
|
||||||
CONF_FOLDER="$FOLDER/conf"
|
CONF_FOLDER="$FOLDER/conf"
|
||||||
LOGS_FOLDER="$FOLDER/logs"
|
LOGS_FOLDER="$FOLDER/logs"
|
||||||
|
DB_FOLDER="$FOLDER/db"
|
||||||
CERTS_FOLDER="$FOLDER/certs"
|
CERTS_FOLDER="$FOLDER/certs"
|
||||||
|
|
||||||
|
|
||||||
@@ -91,7 +92,8 @@ printf "%30s %5s\n" "Version:" "hummingbot/gateway:$GATEWAY_TAG"
|
|||||||
echo
|
echo
|
||||||
printf "%30s %5s\n" "Hummingbot instance ID:" "$HUMMINGBOT_INSTANCE_ID"
|
printf "%30s %5s\n" "Hummingbot instance ID:" "$HUMMINGBOT_INSTANCE_ID"
|
||||||
printf "%30s %5s\n" "Gateway conf path:" "$CONF_FOLDER"
|
printf "%30s %5s\n" "Gateway conf path:" "$CONF_FOLDER"
|
||||||
printf "%30s %5s\n" "Gateway log path:" "$LOGS_FOLDER"
|
printf "%30s %5s\n" "Gateway logs path:" "$LOGS_FOLDER"
|
||||||
|
printf "%30s %5s\n" "Gateway db path:" "$DB_FOLDER"
|
||||||
printf "%30s %5s\n" "Gateway certs path:" "$CERTS_FOLDER"
|
printf "%30s %5s\n" "Gateway certs path:" "$CERTS_FOLDER"
|
||||||
printf "%30s %5s\n" "Gateway port:" "$GATEWAY_PORT"
|
printf "%30s %5s\n" "Gateway port:" "$GATEWAY_PORT"
|
||||||
printf "%30s %5s\n" "Gateway docs port:" "$DOCS_PORT"
|
printf "%30s %5s\n" "Gateway docs port:" "$DOCS_PORT"
|
||||||
@@ -136,6 +138,28 @@ prompt_proceed () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prompt_copy_certs () {
|
||||||
|
echo
|
||||||
|
read -p "Do you want to generate certs from a Hummingbot instance? [Y/N] >>> " PROCEED
|
||||||
|
if [[ "$PROCEED" == "Y" || "$PROCEED" == "y" ]]
|
||||||
|
then
|
||||||
|
mkdir $CERTS_FOLDER
|
||||||
|
sudo chmod a+rw $CERTS_FOLDER
|
||||||
|
prompt_existing_certs_path
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
prompt_copy_lists () {
|
||||||
|
echo
|
||||||
|
read -p "Do you want to generate default token lists? [Y/N] >>> " PROCEED
|
||||||
|
if [[ "$PROCEED" == "Y" || "$PROCEED" == "y" ]]
|
||||||
|
then
|
||||||
|
mkdir $CONF_FOLDER/lists
|
||||||
|
sudo chmod a+rw $CONF_FOLDER/lists
|
||||||
|
docker cp $INSTANCE_NAME:/home/gateway/src/templates/lists/. $CONF_FOLDER/lists/
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Execute docker commands
|
# Execute docker commands
|
||||||
create_instance () {
|
create_instance () {
|
||||||
echo
|
echo
|
||||||
@@ -146,19 +170,20 @@ create_instance () {
|
|||||||
# 2) Create subfolders for gateway files
|
# 2) Create subfolders for gateway files
|
||||||
mkdir $CONF_FOLDER
|
mkdir $CONF_FOLDER
|
||||||
mkdir $LOGS_FOLDER
|
mkdir $LOGS_FOLDER
|
||||||
mkdir $CERTS_FOLDER
|
|
||||||
# 3) Set required permissions to save gateway passphrase the first time
|
# 3) Set required permissions to save gateway passphrase the first time
|
||||||
sudo chmod a+rw $CONF_FOLDER $CERTS_FOLDER
|
sudo chmod a+rw $CONF_FOLDER
|
||||||
prompt_existing_certs_path
|
# 4) Prompt user whether to copy over the Hummingbot certs
|
||||||
|
prompt_copy_certs
|
||||||
|
|
||||||
# Launch a new instance of gateway
|
# Launch a new instance of gateway
|
||||||
docker run -d \
|
docker run -d \
|
||||||
--name $INSTANCE_NAME \
|
--name $INSTANCE_NAME \
|
||||||
-p $GATEWAY_PORT:15888 \
|
-p $GATEWAY_PORT:15888 \
|
||||||
-p $DOCS_PORT:8080 \
|
-p $DOCS_PORT:8080 \
|
||||||
-v $CONF_FOLDER:/usr/src/app/conf \
|
-v $CONF_FOLDER:/home/gateway/conf \
|
||||||
-v $LOGS_FOLDER:/usr/src/app/logs \
|
-v $LOGS_FOLDER:/home/gateway/logs \
|
||||||
-v $CERTS_FOLDER:/usr/src/app/certs \
|
-v $DB_FOLDER:/home/gateway/db \
|
||||||
|
-v $CERTS_FOLDER:/home/gateway/certs \
|
||||||
-e GATEWAY_PASSPHRASE="$PASSPHRASE" \
|
-e GATEWAY_PASSPHRASE="$PASSPHRASE" \
|
||||||
hummingbot/gateway:$GATEWAY_TAG
|
hummingbot/gateway:$GATEWAY_TAG
|
||||||
}
|
}
|
||||||
@@ -166,6 +191,7 @@ prompt_proceed
|
|||||||
if [[ "$PROCEED" == "Y" || "$PROCEED" == "y" ]]
|
if [[ "$PROCEED" == "Y" || "$PROCEED" == "y" ]]
|
||||||
then
|
then
|
||||||
create_instance
|
create_instance
|
||||||
|
prompt_copy_lists
|
||||||
else
|
else
|
||||||
echo "Aborted"
|
echo "Aborted"
|
||||||
echo
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user