Skip to content

Commit

Permalink
chore: introduce emojis in shell script
Browse files Browse the repository at this point in the history
Signed-off-by: STRRL <[email protected]>
  • Loading branch information
STRRL committed Aug 19, 2024
1 parent 2665116 commit 0f1e858
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions automated_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ ARCH=$(uname -m)
# Function to check if Docker is installed and running
check_docker() {
if ! command -v docker &> /dev/null; then
echo "Docker is not installed. Please install Docker: https://docs.docker.com/engine/install/ and rerun this script."
echo "Docker is not installed. Please install Docker: https://docs.docker.com/engine/install/ and rerun this script."
exit 1
fi
if ! docker ps &> /dev/null; then
echo "Docker is not running. Please start Docker and rerun this script."
echo "Docker is not running. Please start Docker and rerun this script."
exit 1
fi
}
Expand All @@ -33,7 +33,7 @@ check_docker_compose() {
elif command -v docker &> /dev/null && docker compose version &> /dev/null; then
COMPOSE_CMD="docker compose"
else
echo "Docker Compose is not installed. Please install Docker Compose: https://docs.docker.com/compose/install/ and rerun this script."
echo "Docker Compose is not installed. Please install Docker Compose: https://docs.docker.com/compose/install/ and rerun this script."
exit 1
fi
}
Expand All @@ -43,7 +43,7 @@ check_docker_compose
# Function to install curl if it's not already installed
install_curl() {
if ! command -v curl &> /dev/null; then
echo "curl is not installed. Please install curl and rerun this script."
echo "curl is not installed. Please install curl and rerun this script."
exit 1
fi
}
Expand All @@ -62,7 +62,7 @@ case $OS in
FILE="${DEPLOYER_NAME}_Darwin_x86_64.tar.gz"
;;
*)
echo "Unsupported architecture: $ARCH"
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
Expand All @@ -79,7 +79,7 @@ case $OS in
FILE="${DEPLOYER_NAME}_Linux_x86_64.tar.gz"
;;
*)
echo "Unsupported architecture: $ARCH"
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
Expand All @@ -96,28 +96,28 @@ case $OS in
FILE="${DEPLOYER_NAME}_Windows_x86_64.zip"
;;
*)
echo "Unsupported architecture: $ARCH"
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
;;
*)
echo "Unsupported operating system: $OS"
echo "Unsupported operating system: $OS"
exit 1
;;
esac

# URL for the download
URL="$DEPLOYER_RELEASE_URL/download/$DEPLOYER_VERSION/$FILE"

echo "Downloading $URL..."
echo "⬇️ Downloading $URL..."

# Download the file
curl -L $URL -o $FILE

# Check if the download was successful
if [ $? -eq 0 ]; then
echo "Download successful, extracting the file..."
echo "📦 Download successful, extracting the file..."

# Extract the file
case $FILE in
Expand All @@ -128,20 +128,20 @@ if [ $? -eq 0 ]; then
unzip $FILE
;;
*)
echo "Unsupported file format: $FILE"
echo "Unsupported file format: $FILE"
exit 1
;;
esac

# Check if the extraction was successful
if [ $? -eq 0 ]; then
echo "Extraction successful."
echo "Extraction successful."
else
echo "Extraction failed."
echo "Extraction failed."
exit 1
fi
else
echo "Download failed."
echo "Download failed."
exit 1
fi

Expand All @@ -150,33 +150,33 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

# Check if config.yaml exists in the script's directory and run Deployer if it does
if [ -f "$SCRIPT_DIR/config.yaml" ]; then
echo "config.yaml found in the script's directory, moving it to config folder..."
echo "⚙️ config.yaml found in the script's directory, moving it to config folder..."

mkdir -p "$SCRIPT_DIR/config"
mv "$SCRIPT_DIR/config.yaml" "$SCRIPT_DIR/config/config.yaml"
echo "DO NOT DELETE/MOVE THE config FOLDER OR ITS CONTENTS!"
echo "⚠️ DO NOT DELETE/MOVE THE config FOLDER OR ITS CONTENTS!"

export NODE_VERSION
echo "running the deployer..."
echo "🚀 Running the deployer..."
"$SCRIPT_DIR/node-automated-deployer" > "$SCRIPT_DIR/docker-compose.yaml"

# Check if docker-compose.yaml was successfully created
if [ -f "$SCRIPT_DIR/docker-compose.yaml" ]; then
echo "docker-compose.yaml created, starting Docker Compose..."
echo "ℹ️ docker-compose.yaml created, starting Docker Compose..."
(cd "$SCRIPT_DIR" && $COMPOSE_CMD up -d)

# Check if Docker Compose started successfully
if [ $? -eq 0 ]; then
echo "Deployment process completed successfully."
echo "Deployment process completed successfully."
echo "🎉 Welcome to the RSS3 Network!"
else
echo "Failed to start Docker Compose."
echo "Failed to start Docker Compose."
exit 1
fi
else
echo "Failed to create docker-compose.yaml."
echo "Failed to create docker-compose.yaml."
exit 1
fi
else
echo "config.yaml not found, please create a config.yaml file or generate one at https://explorer.rss3.io."
fi
echo "⚠️ config.yaml not found, please create a config.yaml file or generate one at https://explorer.rss3.io."
fi

0 comments on commit 0f1e858

Please sign in to comment.