Compare commits
No commits in common. "ed8b09a4bff5f5eb3cf86e66aa81918e34ab3ed8" and "af8f4d7d75b9e5218862e7603b590e15cc54ecd7" have entirely different histories.
ed8b09a4bf
...
af8f4d7d75
22
install.sh
22
install.sh
@ -2,13 +2,12 @@
|
|||||||
|
|
||||||
# URLs for configuration files
|
# URLs for configuration files
|
||||||
DOCKER_COMPOSE_URL="https://git.masscivicdynamic.com/masscivicdynamic/nexo-cloud-scripts/raw/branch/main/docker-compose.yml"
|
DOCKER_COMPOSE_URL="https://git.masscivicdynamic.com/masscivicdynamic/nexo-cloud-scripts/raw/branch/main/docker-compose.yml"
|
||||||
KUBERNETES_DEPLOY_URL="https://git.masscivicdynamic.com/masscivicdynamic/nexo-cloud-scripts/raw/branch/main/kubernets-deploy.yaml"
|
KUBERNETES_DEPLOY_URL="https://git.masscivicdynamic.com/masscivicdynamic/nexo-cloud-scripts/raw/branch/main/kube-deploy.yaml"
|
||||||
ENV_FILE="/data/nexo-cloud/.env"
|
ENV_FILE="/data/nexo-cloud/.env"
|
||||||
DATA_DIR="/data/nexo-cloud"
|
|
||||||
|
|
||||||
# Minimum disk space requirements (in GB)
|
# Minimum disk space requirements (in GB)
|
||||||
MIN_TOTAL_DISK_SPACE=20
|
MIN_TOTAL_DISK_SPACE=30
|
||||||
MIN_AVAILABLE_DISK_SPACE=10
|
MIN_AVAILABLE_DISK_SPACE=20
|
||||||
|
|
||||||
# Function to check if a command exists
|
# Function to check if a command exists
|
||||||
command_exists() {
|
command_exists() {
|
||||||
@ -27,8 +26,8 @@ generate_app_key() {
|
|||||||
|
|
||||||
# Function to check disk space requirements
|
# Function to check disk space requirements
|
||||||
check_disk_space() {
|
check_disk_space() {
|
||||||
local total_space=$(df --output=size "$DATA_DIR" | tail -n 1 | awk '{print $1}')
|
local total_space=$(df --output=size /data | tail -n 1 | awk '{print $1}')
|
||||||
local available_space=$(df --output=avail "$DATA_DIR" | tail -n 1 | awk '{print $1}')
|
local available_space=$(df --output=avail /data | tail -n 1 | awk '{print $1}')
|
||||||
local total_space_gb=$((total_space / 1024 / 1024))
|
local total_space_gb=$((total_space / 1024 / 1024))
|
||||||
local available_space_gb=$((available_space / 1024 / 1024))
|
local available_space_gb=$((available_space / 1024 / 1024))
|
||||||
|
|
||||||
@ -43,19 +42,11 @@ check_disk_space() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to create the folder if it doesn't exist
|
|
||||||
ensure_data_directory() {
|
|
||||||
if [ ! -d "$DATA_DIR" ]; then
|
|
||||||
echo "Creating directory $DATA_DIR..."
|
|
||||||
mkdir -p "$DATA_DIR"
|
|
||||||
echo "Directory $DATA_DIR created successfully."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to handle the .env file
|
# Function to handle the .env file
|
||||||
handle_env_file() {
|
handle_env_file() {
|
||||||
if [ ! -f "$ENV_FILE" ]; then
|
if [ ! -f "$ENV_FILE" ]; then
|
||||||
echo "No .env file found. Creating a new one."
|
echo "No .env file found. Creating a new one."
|
||||||
|
mkdir -p "$(dirname "$ENV_FILE")"
|
||||||
touch "$ENV_FILE"
|
touch "$ENV_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -118,7 +109,6 @@ load_env_file() {
|
|||||||
|
|
||||||
# Main installation logic
|
# Main installation logic
|
||||||
install_application() {
|
install_application() {
|
||||||
ensure_data_directory
|
|
||||||
check_disk_space
|
check_disk_space
|
||||||
handle_env_file
|
handle_env_file
|
||||||
load_env_file
|
load_env_file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user