mirror of
https://github.com/d0zingcat/deploy.git
synced 2026-05-14 07:26:43 +00:00
(feat) deployment scenarios
This commit is contained in:
73
bash_scripts/README.md
Normal file
73
bash_scripts/README.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# Docker commands
|
||||
|
||||
## Setup
|
||||
|
||||
The followings scripts assume that [Docker](https://www.docker.com/) has already been installed.
|
||||
|
||||
They also assume that the user has Docker permissions without requiring `sudo`. If you do not have these permissions:
|
||||
|
||||
1. Enter the following command:
|
||||
|
||||
```
|
||||
sudo usermod -a -G docker $USER
|
||||
```
|
||||
|
||||
2. Run the following command to change the permissions of all files with the ".sh" extension in the current directory, making them executable for all users.:
|
||||
|
||||
```
|
||||
chmod a+x *.sh
|
||||
```
|
||||
|
||||
3. Log out and log back into your console to enable them.
|
||||
|
||||
## Hummingbot Client
|
||||
### Create an instance of Hummingbot
|
||||
|
||||
The `hummingbot-create.sh` script will create the folders needed to run Hummingbot and then install Hummingbot.
|
||||
|
||||
```
|
||||
./create.sh
|
||||
```
|
||||
|
||||
### Start up / connect to an instance of Hummingbot
|
||||
|
||||
The `hummingbot-start.sh` script will connect to a running instance of Hummingbot.
|
||||
|
||||
```
|
||||
./start.sh
|
||||
```
|
||||
|
||||
### Updating Hummingbot version
|
||||
|
||||
The `hummingbot-update.sh` script will update your instance to the latest version of Hummingbot.
|
||||
|
||||
```
|
||||
./update.sh
|
||||
```
|
||||
|
||||
## Gateway
|
||||
### Create Gateway Instance
|
||||
|
||||
The `gateway-create.sh` script helps you pull, configure, and run the Gateway Docker image.
|
||||
|
||||
```
|
||||
./gateway-create.sh
|
||||
```
|
||||
|
||||
### Copy Hummingbot Certs
|
||||
|
||||
If you didn't do this step during `gateway-create.sh`, the `gateway-copy-certs.sh` script helps you copy the SSL certificates generated by Hummingbot into your Gateway files `certs` folder. This lets your Hummingbot instance access Gateway securely.
|
||||
|
||||
```
|
||||
./gateway-copy-certs.sh
|
||||
```
|
||||
|
||||
### Useful Commands
|
||||
|
||||
These commands assume a Gateway container with the default instance name `gateway`:
|
||||
|
||||
* List all Gateway containers: `docker ps -a --filter ancestor=hummingbot/gateway`
|
||||
* Start Gateway container and attach to it: `docker start gateway && docker attach gateway`
|
||||
* Stop Gateway container: `docker stop gateway`
|
||||
* Update Gateway container to latest version: `docker pull hummingbot/gateway:latest`
|
||||
* Remove Gateway container: `docker rm gateway`
|
||||
89
bash_scripts/gateway-copy-certs.sh
Normal file
89
bash_scripts/gateway-copy-certs.sh
Normal file
@@ -0,0 +1,89 @@
|
||||
#!/bin/bash
|
||||
# init
|
||||
# =============================================
|
||||
|
||||
echo
|
||||
echo
|
||||
echo "=============== COPY CERTS TO GATEWAY FOLDER ==============="
|
||||
echo
|
||||
echo "ℹ️ Press [ENTER] for default values:"
|
||||
echo
|
||||
|
||||
# Ask for Gateway instance name
|
||||
echo "List of all Gateway containers:"
|
||||
docker ps -a --filter ancestor=hummingbot/gateway
|
||||
echo
|
||||
read -p "Enter Gateway container name (default = \"gateway\") >>> " INSTANCE_NAME
|
||||
echo
|
||||
if [ "$INSTANCE_NAME" == "" ]
|
||||
then
|
||||
INSTANCE_NAME="gateway"
|
||||
fi
|
||||
DEFAULT_FOLDER="${INSTANCE_NAME}_files/certs"
|
||||
echo
|
||||
echo "Stopping container: $INSTANCE_NAME"
|
||||
docker stop $INSTANCE_NAME
|
||||
|
||||
# Ask for path to Hummingbot certs folder
|
||||
read -p "Enter path to the Hummingbot certs folder >>> " CERTS_FROM_PATH
|
||||
if [ ! -d "$CERTS_FROM_PATH" ]; then
|
||||
echo "Error: $CERTS_FROM_PATH does not exist or is not a directory"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Ask for path to Gateway files folder
|
||||
read -p "Enter path to the Gateway certs folder (default = \"./gateway-files/certs/\") >>> " FOLDER
|
||||
if [ "$FOLDER" == "" ]
|
||||
then
|
||||
FOLDER=$PWD/$DEFAULT_FOLDER
|
||||
elif [[ ${FOLDER::1} != "/" ]]; then
|
||||
FOLDER=$PWD/$FOLDER
|
||||
fi
|
||||
CERTS_TO_PATH="$FOLDER"
|
||||
|
||||
prompt_proceed () {
|
||||
read -p "Do you want to proceed? [Y/N] >>> " PROCEED
|
||||
if [ "$PROCEED" == "" ]
|
||||
then
|
||||
prompt_proceed
|
||||
else
|
||||
if [[ "$PROCEED" != "Y" && "$PROCEED" != "y" ]]
|
||||
then
|
||||
PROCEED="N"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
copy_certs () {
|
||||
# Copy all files in the source folder to the destination folder
|
||||
cp -r $CERTS_FROM_PATH/* $CERTS_TO_PATH/
|
||||
|
||||
# Confirm that the files were copied
|
||||
echo
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Files successfully copied from $CERTS_FROM_PATH to $CERTS_TO_PATH"
|
||||
else
|
||||
echo "Error copying files from $CERTS_FROM_PATH to $CERTS_TO_PATH"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "Starting container: $INSTANCE_NAME"
|
||||
docker start $INSTANCE_NAME && docker attach $INSTANCE_NAME
|
||||
echo
|
||||
}
|
||||
|
||||
# Ask user to confirm and proceed
|
||||
echo
|
||||
echo "ℹ️ Confirm if this is correct:"
|
||||
echo
|
||||
printf "%30s %5s\n" "Copy certs FROM:" "$CERTS_FROM_PATH"
|
||||
printf "%30s %5s\n" "Copy certs TO:" "$CERTS_TO_PATH"
|
||||
echo
|
||||
prompt_proceed
|
||||
if [[ "$PROCEED" == "Y" || "$PROCEED" == "y" ]]
|
||||
then
|
||||
copy_certs
|
||||
else
|
||||
echo "Exiting..."
|
||||
exit
|
||||
fi
|
||||
157
bash_scripts/gateway-create.sh
Normal file
157
bash_scripts/gateway-create.sh
Normal file
@@ -0,0 +1,157 @@
|
||||
#!/bin/bash
|
||||
# init
|
||||
|
||||
echo
|
||||
echo
|
||||
echo "=============== CREATE A NEW GATEWAY INSTANCE ==============="
|
||||
echo
|
||||
echo
|
||||
echo "ℹ️ Press [ENTER] for default values:"
|
||||
echo
|
||||
|
||||
echo
|
||||
read -p "Enter Gateway version you want to use [latest/development] (default = \"latest\") >>> " GATEWAY_TAG
|
||||
if [ "$GATEWAY_TAG" == "" ]
|
||||
then
|
||||
GATEWAY_TAG="latest"
|
||||
fi
|
||||
|
||||
# Ask the user for the name of the new Gateway instance
|
||||
read -p "Enter a name for your new Gateway instance (default = \"gateway\") >>> " INSTANCE_NAME
|
||||
if [ "$INSTANCE_NAME" == "" ]
|
||||
then
|
||||
INSTANCE_NAME="gateway"
|
||||
DEFAULT_FOLDER="gateway_files"
|
||||
else
|
||||
DEFAULT_FOLDER="${INSTANCE_NAME}_files"
|
||||
fi
|
||||
|
||||
# Ask the user for the folder location to save files
|
||||
read -p "Enter the folder name where your Gateway files will be saved (default = \"$DEFAULT_FOLDER\") >>> " FOLDER
|
||||
if [ "$FOLDER" == "" ]
|
||||
then
|
||||
FOLDER=$PWD/$DEFAULT_FOLDER
|
||||
elif [[ ${FOLDER::1} != "/" ]]; then
|
||||
FOLDER=$PWD/$FOLDER
|
||||
fi
|
||||
CONF_FOLDER="$FOLDER/conf"
|
||||
LOGS_FOLDER="$FOLDER/logs"
|
||||
CERTS_FOLDER="$FOLDER/certs"
|
||||
|
||||
|
||||
# Ask the user for the hummingbot certs passphrase
|
||||
prompt_passphrase () {
|
||||
echo
|
||||
read -s -p "Enter the passphrase you used to generate certificates in Hummingbot >>> " PASSPHRASE
|
||||
if [ "$PASSPHRASE" == "" ]
|
||||
then
|
||||
echo
|
||||
echo
|
||||
echo "!! Error: passphrase cannot be blank"
|
||||
prompt_passphrase
|
||||
fi
|
||||
}
|
||||
prompt_passphrase
|
||||
|
||||
# Get GMT offset from local system time
|
||||
GMT_OFFSET=$(date +%z)
|
||||
|
||||
# Check available open port for Gateway
|
||||
PORT=15888
|
||||
LIMIT=$((PORT+1000))
|
||||
while [[ $PORT -le LIMIT ]]
|
||||
do
|
||||
if [[ $(netstat -nat | grep "$PORT") ]]; then
|
||||
# check another port
|
||||
((PORT = PORT + 1))
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
echo "ℹ️ Confirm below if the instance and its folders are correct:"
|
||||
echo
|
||||
|
||||
printf "%30s %5s\n" "Gateway instance name:" "$INSTANCE_NAME"
|
||||
printf "%30s %5s\n" "Version:" "hummingbot/gateway:$GATEWAY_TAG"
|
||||
echo
|
||||
printf "%30s %5s\n" "Hummingbot instance ID:" "$HUMMINGBOT_INSTANCE_ID"
|
||||
printf "%30s %5s\n" "Gateway conf path:" "$CONF_FOLDER"
|
||||
printf "%30s %5s\n" "Gateway log path:" "$LOGS_FOLDER"
|
||||
printf "%30s %5s\n" "Gateway certs path:" "$CERTS_FOLDER"
|
||||
printf "%30s %5s\n" "Gateway port:" "$PORT"
|
||||
echo
|
||||
|
||||
prompt_existing_certs_path () {
|
||||
echo
|
||||
read -p "Enter the path to the folder where Hummingbot certificates are stored >>> " CERTS_PATH_TO_COPY
|
||||
if [ "$CERTS_PATH_TO_COPY" == "" ]
|
||||
then
|
||||
echo
|
||||
echo "After installation, set certificatePath in $CONF_FOLDER/server.yml and restart Gateway"
|
||||
else
|
||||
# Check if source folder exists
|
||||
if [ ! -d "$CERTS_PATH_TO_COPY" ]; then
|
||||
echo "Error: $CERTS_PATH_TO_COPY does not exist or is not a directory"
|
||||
exit 1
|
||||
fi
|
||||
# Copy all files in the source folder to the destination folder
|
||||
cp -r $CERTS_PATH_TO_COPY/* $CERTS_FOLDER/
|
||||
# Confirm that the files were copied
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Files successfully copied from $CERTS_PATH_TO_COPY to $CERTS_FOLDER"
|
||||
else
|
||||
echo "Error copying files from $CERTS_PATH_TO_COPY to $CERTS_FOLDER"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
prompt_proceed () {
|
||||
echo
|
||||
read -p "Do you want to proceed with installation? [Y/N] >>> " PROCEED
|
||||
if [ "$PROCEED" == "" ]
|
||||
then
|
||||
prompt_proceed
|
||||
else
|
||||
if [[ "$PROCEED" != "Y" && "$PROCEED" != "y" ]]
|
||||
then
|
||||
PROCEED="N"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Execute docker commands
|
||||
create_instance () {
|
||||
echo
|
||||
echo "Creating Gateway instance ... "
|
||||
echo
|
||||
# 1) Create main folder for your new instance
|
||||
mkdir $FOLDER
|
||||
# 2) Create subfolders for gateway files
|
||||
mkdir $CONF_FOLDER
|
||||
mkdir $LOGS_FOLDER
|
||||
mkdir $CERTS_FOLDER
|
||||
# 3) Set required permissions to save gateway passphrase the first time
|
||||
sudo chmod a+rw $CONF_FOLDER $CERTS_FOLDER
|
||||
prompt_existing_certs_path
|
||||
|
||||
# Launch a new instance of gateway
|
||||
docker run \
|
||||
--name $INSTANCE_NAME \
|
||||
-p $PORT:$PORT \
|
||||
-v $CONF_FOLDER:/usr/src/app/conf \
|
||||
-v $LOGS_FOLDER:/usr/src/app/logs \
|
||||
-v $CERTS_FOLDER:/usr/src/app/certs \
|
||||
-e GATEWAY_PASSPHRASE="$PASSPHRASE" \
|
||||
hummingbot/gateway:$GATEWAY_TAG
|
||||
}
|
||||
prompt_proceed
|
||||
if [[ "$PROCEED" == "Y" || "$PROCEED" == "y" ]]
|
||||
then
|
||||
create_instance
|
||||
else
|
||||
echo " Aborted"
|
||||
echo
|
||||
fi
|
||||
105
bash_scripts/hummingbot-create.sh
Normal file
105
bash_scripts/hummingbot-create.sh
Normal file
@@ -0,0 +1,105 @@
|
||||
#!/bin/bash
|
||||
# init
|
||||
|
||||
echo
|
||||
echo
|
||||
echo "=============== CREATE A NEW HUMMINGBOT INSTANCE ==============="
|
||||
echo
|
||||
echo
|
||||
echo "ℹ️ Press [ENTER] for default values:"
|
||||
echo
|
||||
|
||||
# Specify hummingbot version
|
||||
read -p " Enter Hummingbot version you want to use [latest/development] (default = \"latest\") >>> " TAG
|
||||
if [ "$TAG" == "" ]
|
||||
then
|
||||
TAG="latest"
|
||||
fi
|
||||
|
||||
# Ask the user for the name of the new instance
|
||||
read -p " Enter a name for your new Hummingbot instance (default = \"hummingbot\") >>> " INSTANCE_NAME
|
||||
if [ "$INSTANCE_NAME" == "" ]
|
||||
then
|
||||
INSTANCE_NAME="hummingbot"
|
||||
DEFAULT_FOLDER="hummingbot_files"
|
||||
else
|
||||
DEFAULT_FOLDER="${INSTANCE_NAME}_files"
|
||||
fi
|
||||
|
||||
# Ask the user for the folder location to save files
|
||||
read -p " Enter a folder name where your Hummingbot files will be saved (default = \"$DEFAULT_FOLDER\") >>> " FOLDER
|
||||
if [ "$FOLDER" == "" ]
|
||||
then
|
||||
FOLDER=$PWD/$DEFAULT_FOLDER
|
||||
elif [[ ${FOLDER::1} != "/" ]]; then
|
||||
FOLDER=$PWD/$FOLDER
|
||||
fi
|
||||
CONF_FOLDER="$FOLDER/conf"
|
||||
LOGS_FOLDER="$FOLDER/logs"
|
||||
DATA_FOLDER="$FOLDER/data"
|
||||
PMM_SCRIPTS_FOLDER="$FOLDER/pmm-scripts"
|
||||
SCRIPTS_FOLDER="$FOLDER/scripts"
|
||||
CERTS_FOLDER="$FOLDER/certs"
|
||||
|
||||
echo
|
||||
echo "ℹ️ Confirm below if the instance and its folders are correct:"
|
||||
echo
|
||||
printf "%30s %5s\n" "Instance name:" "$INSTANCE_NAME"
|
||||
printf "%30s %5s\n" "Version:" "hummingbot/hummingbot:$TAG"
|
||||
echo
|
||||
printf "%30s %5s\n" "Main folder path:" "$FOLDER"
|
||||
printf "%30s %5s\n" "Config files:" "├── $CONF_FOLDER"
|
||||
printf "%30s %5s\n" "Log files:" "├── $LOGS_FOLDER"
|
||||
printf "%30s %5s\n" "Trade and data files:" "├── $DATA_FOLDER"
|
||||
printf "%30s %5s\n" "PMM scripts files:" "├── $PMM_SCRIPTS_FOLDER"
|
||||
printf "%30s %5s\n" "Scripts files:" "├── $SCRIPTS_FOLDER"
|
||||
printf "%30s %5s\n" "Cert files:" "├── $CERTS_FOLDER"
|
||||
echo
|
||||
|
||||
prompt_proceed () {
|
||||
read -p " Do you want to proceed? [Y/N] >>> " PROCEED
|
||||
if [ "$PROCEED" == "" ]
|
||||
then
|
||||
PROCEED="Y"
|
||||
fi
|
||||
}
|
||||
|
||||
# Execute docker commands
|
||||
create_instance () {
|
||||
echo
|
||||
echo "Creating Hummingbot instance ... Admin password may be required to set the required permissions ..."
|
||||
echo
|
||||
# 1) Create main folder for your new instance
|
||||
mkdir $FOLDER
|
||||
# 2) Create subfolders for hummingbot files
|
||||
mkdir $CONF_FOLDER
|
||||
mkdir $CONF_FOLDER/connectors
|
||||
mkdir $CONF_FOLDER/strategies
|
||||
mkdir $LOGS_FOLDER
|
||||
mkdir $DATA_FOLDER
|
||||
mkdir $PMM_SCRIPTS_FOLDER
|
||||
mkdir $CERTS_FOLDER
|
||||
mkdir $SCRIPTS_FOLDER
|
||||
# 3) Set required permissions to save hummingbot password the first time
|
||||
sudo chmod a+rw $CONF_FOLDER $CERTS_FOLDER
|
||||
# 4) Launch a new instance of hummingbot
|
||||
docker run -it --log-opt max-size=10m --log-opt max-file=5 \
|
||||
--name $INSTANCE_NAME \
|
||||
--network host \
|
||||
-v $CONF_FOLDER:/conf \
|
||||
-v $LOGS_FOLDER:/logs \
|
||||
-v $DATA_FOLDER:/data \
|
||||
-v $PMM_SCRIPTS_FOLDER:/pmm_scripts \
|
||||
-v $SCRIPTS_FOLDER:/scripts \
|
||||
-v $CERTS_FOLDER:/certs \
|
||||
hummingbot/hummingbot:$TAG
|
||||
}
|
||||
|
||||
prompt_proceed
|
||||
if [[ "$PROCEED" == "Y" || "$PROCEED" == "y" ]]
|
||||
then
|
||||
create_instance
|
||||
else
|
||||
echo " Aborted"
|
||||
echo
|
||||
fi
|
||||
21
bash_scripts/hummingbot-start.sh
Normal file
21
bash_scripts/hummingbot-start.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# init
|
||||
# =============================================
|
||||
# SCRIPT COMMANDS
|
||||
echo
|
||||
echo "=============== START HUMMINGBOT INSTANCE ==============="
|
||||
echo
|
||||
echo "List of all docker instances:"
|
||||
echo
|
||||
docker ps -a
|
||||
echo
|
||||
echo
|
||||
read -p " Enter the NAME of the Hummingbot instance to start or connect to (default = \"hummingbot-instance\") >>> " INSTANCE_NAME
|
||||
if [ "$INSTANCE_NAME" == "" ]
|
||||
then
|
||||
INSTANCE_NAME="hummingbot-instance"
|
||||
fi
|
||||
echo
|
||||
# =============================================
|
||||
# EXECUTE SCRIPT
|
||||
docker start $INSTANCE_NAME && docker attach $INSTANCE_NAME
|
||||
148
bash_scripts/hummingbot-update.sh
Normal file
148
bash_scripts/hummingbot-update.sh
Normal file
@@ -0,0 +1,148 @@
|
||||
#!/bin/bash
|
||||
# init
|
||||
# =============================================
|
||||
|
||||
# Specify hummingbot version
|
||||
select_version () {
|
||||
echo
|
||||
echo
|
||||
echo "=============== UPDATE HUMMINGBOT INSTANCE ==============="
|
||||
echo
|
||||
echo
|
||||
echo "ℹ️ Press [ENTER] for default values:"
|
||||
echo
|
||||
read -p " Enter Hummingbot version to update [latest/development] (default = \"latest\") >>> " TAG
|
||||
if [ "$TAG" == "" ]
|
||||
then
|
||||
TAG="latest"
|
||||
fi
|
||||
}
|
||||
|
||||
# List all docker instances using the same image
|
||||
list_instances () {
|
||||
echo
|
||||
echo "List of all docker containers using the \"$TAG\" version:"
|
||||
echo
|
||||
docker ps -a --filter ancestor=hummingbot/hummingbot:$TAG
|
||||
echo
|
||||
echo "⚠️ WARNING: This will attempt to update all instances. Any containers not in Exited () STATUS will cause the update to fail."
|
||||
echo
|
||||
echo "ℹ️ TIP: Connect to a running instance using \"./start.sh\" command and \"exit\" from inside Hummingbot."
|
||||
echo "ℹ️ TIP: You can also remove unused instances by running \"docker rm [NAME]\" in the terminal."
|
||||
echo
|
||||
read -p " Do you want to continue? [Y/N] >>> " CONTINUE
|
||||
if [ "$CONTINUE" == "" ]
|
||||
then
|
||||
CONTINUE="Y"
|
||||
fi
|
||||
}
|
||||
|
||||
# List all directories in the current folder
|
||||
list_dir () {
|
||||
echo
|
||||
echo " List of folders in your directory:"
|
||||
echo
|
||||
ls -d1 */ 2>&1 | sed 's/^/ 📁 /'
|
||||
echo
|
||||
}
|
||||
|
||||
# Ask the user for the folder location of each instance
|
||||
prompt_folder () {
|
||||
for instance in "${INSTANCES[@]}"
|
||||
do
|
||||
if [ "$instance" == "hummingbot-instance" ]
|
||||
then
|
||||
DEFAULT_FOLDER="hummingbot_files"
|
||||
else
|
||||
DEFAULT_FOLDER="${instance}_files"
|
||||
fi
|
||||
read -p " Enter the destination folder for $instance (default = \"$DEFAULT_FOLDER\") >>> " FOLDER
|
||||
if [ "$FOLDER" == "" ]
|
||||
then
|
||||
FOLDER=$PWD/$DEFAULT_FOLDER
|
||||
elif [[ ${FOLDER::1} != "/" ]]; then
|
||||
FOLDER=$PWD/$FOLDER
|
||||
fi
|
||||
# Store folder names into an array
|
||||
FOLDERS+=($FOLDER)
|
||||
done
|
||||
}
|
||||
|
||||
# Display instances and destination folders then prompt to proceed
|
||||
confirm_update () {
|
||||
echo
|
||||
echo "ℹ️ Confirm below if the instances and their folders are correct:"
|
||||
echo
|
||||
num="0"
|
||||
printf "%30s %5s %10s\n" "INSTANCE" " " "FOLDER"
|
||||
for instance in "${INSTANCES[@]}"
|
||||
do
|
||||
printf "%30s %5s %10s\n" ${INSTANCES[$num]} " ----------> " ${FOLDERS[$num]}
|
||||
num=$[$num+1]
|
||||
done
|
||||
echo
|
||||
read -p " Proceed? [Y/N] >>> " PROCEED
|
||||
if [ "$PROCEED" == "" ]
|
||||
then
|
||||
PROCEED="Y"
|
||||
fi
|
||||
}
|
||||
|
||||
# Execute docker commands
|
||||
execute_docker () {
|
||||
# 1) Delete instance and old hummingbot image
|
||||
echo
|
||||
echo "Removing docker containers first ..."
|
||||
docker rm ${INSTANCES[@]}
|
||||
echo
|
||||
# 2) Delete old image
|
||||
docker image rm hummingbot/hummingbot:$TAG
|
||||
# 3) Re-create instances with the most recent hummingbot version
|
||||
echo "Re-creating docker containers with updated image ..."
|
||||
j="0"
|
||||
for instance in "${INSTANCES[@]}"
|
||||
do
|
||||
docker run -itd --log-opt max-size=10m --log-opt max-file=5 \
|
||||
--network host \
|
||||
--name ${INSTANCES[$j]} \
|
||||
-v $CONF_FOLDER:/conf \
|
||||
-v $LOGS_FOLDER:/logs \
|
||||
-v $DATA_FOLDER:/data \
|
||||
-v $PMM_SCRIPTS_FOLDER:/pmm_scripts \
|
||||
-v $SCRIPTS_FOLDER:/scripts \
|
||||
-v $CERTS_FOLDER:/certs \
|
||||
hummingbot/hummingbot:$TAG
|
||||
j=$[$j+1]
|
||||
# Update file ownership
|
||||
done
|
||||
echo
|
||||
echo "Update complete! All running docker instances:"
|
||||
echo
|
||||
docker ps
|
||||
echo
|
||||
echo "ℹ️ Run command \"./start.sh\" to connect to an instance."
|
||||
echo
|
||||
}
|
||||
|
||||
select_version
|
||||
list_instances
|
||||
if [ "$CONTINUE" == "Y" ]
|
||||
then
|
||||
# Store instance names in an array
|
||||
declare -a INSTANCES
|
||||
INSTANCES=( $(docker ps -a --filter ancestor=hummingbot/hummingbot:$TAG --format "{{.Names}}") )
|
||||
list_dir
|
||||
declare -a FOLDERS
|
||||
prompt_folder
|
||||
confirm_update
|
||||
if [ "$PROCEED" == "Y" ]
|
||||
then
|
||||
execute_docker
|
||||
else
|
||||
echo " Update aborted"
|
||||
echo
|
||||
fi
|
||||
else
|
||||
echo " Update aborted"
|
||||
echo
|
||||
fi
|
||||
Reference in New Issue
Block a user