Standard env init.
This commit is contained in:
@@ -45,15 +45,13 @@ if [ -z "${APP_NAME}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d ".wildcloud" ]; then
|
||||
echo "Error: .wildcloud directory not found in current directory"
|
||||
echo "This script must be run from a directory that contains a .wildcloud directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f ".wildcloud/config.yaml" ]; then
|
||||
echo "Error: .wildcloud/config.yaml not found"
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
CACHE_APP_DIR=".wildcloud/cache/apps/${APP_NAME}"
|
||||
|
@@ -61,6 +61,15 @@ if [ ! -d "apps/${APP_NAME}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
# Confirmation prompt (unless --force or --dry-run)
|
||||
if [ "${FORCE}" != true ] && [ "${DRY_RUN:-}" != "--dry-run=client" ]; then
|
||||
echo "WARNING: This will delete all resources for app '${APP_NAME}'"
|
||||
|
@@ -43,6 +43,15 @@ if [ ! -d "apps/${APP_NAME}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
# Function to deploy secrets for an app
|
||||
deploy_secrets() {
|
||||
local app_name="$1"
|
||||
|
@@ -7,13 +7,6 @@ KEEP_RESOURCES=false
|
||||
FOLLOW_LOGS=false
|
||||
TIMEOUT=120
|
||||
|
||||
# Source environment variables from load-env.sh
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
if [ -f "$REPO_DIR/load-env.sh" ]; then
|
||||
source "$REPO_DIR/load-env.sh"
|
||||
fi
|
||||
|
||||
function show_help {
|
||||
echo "Usage: $0 APP_NAME [options]"
|
||||
echo ""
|
||||
@@ -85,6 +78,15 @@ if [[ -z "$APP_NAME" ]]; then
|
||||
show_help
|
||||
fi
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
# Check if doctor directory exists
|
||||
DOCTOR_DIR="$REPO_DIR/apps/$APP_NAME/doctor"
|
||||
if [[ ! -d "$DOCTOR_DIR" ]]; then
|
||||
|
@@ -45,25 +45,16 @@ if [ -z "${APP_NAME}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d ".wildcloud" ]; then
|
||||
echo "Error: .wildcloud directory not found in current directory"
|
||||
echo "This script must be run from a directory that contains a .wildcloud directory"
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
if [ ! -f ".wildcloud/config.yaml" ]; then
|
||||
echo "Error: .wildcloud/config.yaml not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
WILDCLOUD_REPO=$(yq eval '.wildcloud.repository' .wildcloud/config.yaml)
|
||||
|
||||
if [ -z "${WILDCLOUD_REPO}" ] || [ "${WILDCLOUD_REPO}" = "null" ]; then
|
||||
echo "Error: wildcloud.config not found in .wildcloud/config.yaml"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SOURCE_APP_DIR="${WILDCLOUD_REPO}/apps/${APP_NAME}"
|
||||
SOURCE_APP_DIR="${WC_ROOT}/apps/${APP_NAME}"
|
||||
if [ ! -d "${SOURCE_APP_DIR}" ]; then
|
||||
echo "Error: App '${APP_NAME}' not found at ${SOURCE_APP_DIR}"
|
||||
exit 1
|
||||
|
@@ -48,11 +48,16 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Get the path to the Wild-Cloud repository (where this script is located)
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
WILDCLOUD_REPO="$(dirname "${SCRIPT_DIR}")"
|
||||
APPS_DIR="${WILDCLOUD_REPO}/apps"
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
APPS_DIR="${WC_ROOT}/apps"
|
||||
if [ ! -d "${APPS_DIR}" ]; then
|
||||
echo "Error: Apps directory not found at ${APPS_DIR}"
|
||||
exit 1
|
||||
|
@@ -3,12 +3,6 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Source common utilities
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/wild-common.sh"
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
init_wild_env
|
||||
|
||||
# Usage function
|
||||
usage() {
|
||||
echo "Usage: wild-cluster-config-generate [options]"
|
||||
@@ -55,18 +49,13 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Check if we're in a wild-cloud directory
|
||||
if [ ! -d ".wildcloud" ]; then
|
||||
print_error "You must run this script from a wild-cloud directory"
|
||||
print_info "Run 'wild-setup' or 'wild-init' first to initialize a wild-cloud project"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if talosctl is available
|
||||
if ! command -v talosctl >/dev/null 2>&1; then
|
||||
print_error "talosctl not found in PATH"
|
||||
print_info "Please install talosctl to generate cluster configurations"
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
# =============================================================================
|
||||
|
@@ -3,12 +3,6 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Source common utilities
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/wild-common.sh"
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
init_wild_env
|
||||
|
||||
# Usage function
|
||||
usage() {
|
||||
echo "Usage: wild-cluster-node-image-create [options]"
|
||||
@@ -48,11 +42,13 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Check if we're in a wild-cloud directory
|
||||
if [ ! -d ".wildcloud" ]; then
|
||||
print_error "You must run this script from a wild-cloud directory"
|
||||
print_info "Run 'wild-setup' or 'wild-init' first to initialize a wild-cloud project"
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
# Configure basic settings if needed
|
||||
|
@@ -3,12 +3,6 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Source common utilities
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/wild-common.sh"
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
init_wild_env
|
||||
|
||||
# Usage function
|
||||
usage() {
|
||||
echo "Usage: wild-cluster-node-machine-config-generate <node-ip>"
|
||||
@@ -72,7 +66,14 @@ if [ -z "$NODE_IP" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check_wild_directory
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
# Check required configuration
|
||||
if [ -z "$(get_current_config "cluster.name")" ]; then
|
||||
|
@@ -3,12 +3,6 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Source common utilities
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/wild-common.sh"
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
init_wild_env
|
||||
|
||||
# Usage function
|
||||
usage() {
|
||||
echo "Usage: wild-cluster-node-up <node-ip> [options]"
|
||||
@@ -84,8 +78,14 @@ if [ -z "$NODE_IP" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if we're in a wild-cloud directory
|
||||
check_wild_directory
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
# Check required configuration
|
||||
if [ -z "$(get_current_config "cluster.name")" ]; then
|
||||
|
@@ -3,13 +3,6 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Source common utilities
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/wild-common.sh"
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
init_wild_env
|
||||
|
||||
|
||||
# Usage function
|
||||
usage() {
|
||||
echo "Usage: wild-cluster-services-generate [options]"
|
||||
@@ -56,18 +49,13 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Check if we're in a wild-cloud directory
|
||||
if [ ! -d ".wildcloud" ]; then
|
||||
print_error "You must run this script from a wild-cloud directory"
|
||||
print_info "Run 'wild-setup' or 'wild-init' first to initialize a wild-cloud project"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if basic configuration exists
|
||||
if [ ! -f "${WC_HOME}/config.yaml" ]; then
|
||||
print_error "Configuration file not found: ${WC_HOME}/config.yaml"
|
||||
print_info "Run 'wild-setup' first to configure your cluster"
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
# =============================================================================
|
||||
|
@@ -3,13 +3,6 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Source common utilities
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/wild-common.sh"
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
init_wild_env
|
||||
|
||||
|
||||
# Usage function
|
||||
usage() {
|
||||
echo "Usage: wild-cluster-services-up [options] [service...]"
|
||||
@@ -70,11 +63,13 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Check if we're in a wild-cloud directory
|
||||
if [ ! -d ".wildcloud" ]; then
|
||||
print_error "You must run this script from a wild-cloud directory"
|
||||
print_info "Run 'wild-setup' or 'wild-init' first to initialize a wild-cloud project"
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
CLUSTER_SETUP_DIR="${WC_HOME}/setup/cluster"
|
||||
|
@@ -1,262 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# wild-common.sh
|
||||
# Common utility functions for Wild-Cloud shell scripts
|
||||
# Source this file at the beginning of scripts to access shared functionality
|
||||
#
|
||||
# USAGE PATTERN:
|
||||
# Replace the common function definitions in your script with:
|
||||
#
|
||||
# #!/bin/bash
|
||||
# set -e
|
||||
# set -o pipefail
|
||||
#
|
||||
# # Source common utilities
|
||||
# source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/wild-common.sh"
|
||||
#
|
||||
# # Initialize Wild-Cloud environment
|
||||
# init_wild_env
|
||||
#
|
||||
# AVAILABLE FUNCTIONS:
|
||||
# - Print functions: print_header, print_info, print_warning, print_success, print_error
|
||||
# - Config functions: get_current_config, get_current_secret, prompt_with_default
|
||||
# - Config helpers: prompt_if_unset_config, prompt_if_unset_secret
|
||||
# - Validation: check_wild_directory, check_basic_config
|
||||
# - Utilities: command_exists, file_readable, dir_writable, generate_random_string
|
||||
|
||||
# =============================================================================
|
||||
# COLOR VARIABLES
|
||||
# =============================================================================
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# =============================================================================
|
||||
# PRINT FUNCTIONS
|
||||
# =============================================================================
|
||||
|
||||
# Print functions for consistent output formatting
|
||||
print_header() {
|
||||
echo -e "\n${BLUE}=== $1 ===${NC}\n"
|
||||
}
|
||||
|
||||
print_info() {
|
||||
echo -e "${BLUE}INFO:${NC} $1"
|
||||
}
|
||||
|
||||
print_warning() {
|
||||
echo -e "${YELLOW}WARNING:${NC} $1"
|
||||
}
|
||||
|
||||
print_success() {
|
||||
echo -e "${GREEN}SUCCESS:${NC} $1"
|
||||
}
|
||||
|
||||
print_error() {
|
||||
echo -e "${RED}ERROR:${NC} $1"
|
||||
}
|
||||
|
||||
# =============================================================================
|
||||
# CONFIGURATION UTILITIES
|
||||
# =============================================================================
|
||||
|
||||
# Function to get current config value safely
|
||||
get_current_config() {
|
||||
local key="$1"
|
||||
if [ -f "${WC_HOME}/config.yaml" ]; then
|
||||
set +e
|
||||
result=$(wild-config "${key}" 2>/dev/null)
|
||||
set -e
|
||||
echo "${result}"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to get current secret value safely
|
||||
get_current_secret() {
|
||||
local key="$1"
|
||||
if [ -f "${WC_HOME}/secrets.yaml" ]; then
|
||||
set +e
|
||||
result=$(wild-secret "${key}" 2>/dev/null)
|
||||
set -e
|
||||
echo "${result}"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to prompt for input with default value
|
||||
prompt_with_default() {
|
||||
local prompt="$1"
|
||||
local default="$2"
|
||||
local current_value="$3"
|
||||
local result
|
||||
|
||||
if [ -n "${current_value}" ] && [ "${current_value}" != "null" ]; then
|
||||
printf "%s [current: %s]: " "${prompt}" "${current_value}" >&2
|
||||
read -r result
|
||||
if [ -z "${result}" ]; then
|
||||
result="${current_value}"
|
||||
fi
|
||||
elif [ -n "${default}" ]; then
|
||||
printf "%s [default: %s]: " "${prompt}" "${default}" >&2
|
||||
read -r result
|
||||
if [ -z "${result}" ]; then
|
||||
result="${default}"
|
||||
fi
|
||||
else
|
||||
printf "%s: " "${prompt}" >&2
|
||||
read -r result
|
||||
while [ -z "${result}" ]; do
|
||||
printf "This value is required. Please enter a value: " >&2
|
||||
read -r result
|
||||
done
|
||||
fi
|
||||
|
||||
echo "${result}"
|
||||
}
|
||||
|
||||
# Prompt for config value only if it's not already set
|
||||
prompt_if_unset_config() {
|
||||
local config_path="$1"
|
||||
local prompt="$2"
|
||||
local default="$3"
|
||||
|
||||
local current_value
|
||||
current_value=$(get_current_config "${config_path}")
|
||||
|
||||
if [ -z "${current_value}" ] || [ "${current_value}" = "null" ]; then
|
||||
local new_value
|
||||
new_value=$(prompt_with_default "${prompt}" "${default}" "")
|
||||
wild-config-set "${config_path}" "${new_value}"
|
||||
print_info "Set ${config_path} = ${new_value}"
|
||||
else
|
||||
print_info "Using existing ${config_path} = ${current_value}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Prompt for secret value only if it's not already set
|
||||
prompt_if_unset_secret() {
|
||||
local secret_path="$1"
|
||||
local prompt="$2"
|
||||
local default="$3"
|
||||
|
||||
local current_value
|
||||
current_value=$(get_current_secret "${secret_path}")
|
||||
|
||||
if [ -z "${current_value}" ] || [ "${current_value}" = "null" ]; then
|
||||
local new_value
|
||||
new_value=$(prompt_with_default "${prompt}" "${default}" "")
|
||||
wild-secret-set "${secret_path}" "${new_value}"
|
||||
print_info "Set secret ${secret_path}"
|
||||
else
|
||||
print_info "Using existing secret ${secret_path}"
|
||||
fi
|
||||
}
|
||||
|
||||
# =============================================================================
|
||||
# ENVIRONMENT SETUP
|
||||
# =============================================================================
|
||||
|
||||
# Find the wild-cloud project home directory by searching for .wildcloud
|
||||
# Returns the path to the project root, or empty string if not found
|
||||
find_wc_home() {
|
||||
local current_dir="$(pwd)"
|
||||
|
||||
while [ "$current_dir" != "/" ]; do
|
||||
if [ -d "$current_dir/.wildcloud" ]; then
|
||||
echo "$current_dir"
|
||||
return 0
|
||||
fi
|
||||
current_dir="$(dirname "$current_dir")"
|
||||
done
|
||||
|
||||
# Not found
|
||||
return 1
|
||||
}
|
||||
|
||||
# Initialize common Wild-Cloud environment variables
|
||||
# Call this function at the beginning of scripts
|
||||
init_wild_env() {
|
||||
# Get WC_ROOT (where this script and templates live)
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
WC_ROOT="$(cd "$(dirname "${BASH_SOURCE[1]}")/.." && pwd)"
|
||||
export WC_ROOT
|
||||
fi
|
||||
|
||||
# Set up cloud directory (WC_HOME is where user's cloud is)
|
||||
# Look for .wildcloud directory in current path or ancestors
|
||||
if [ -z "${WC_HOME}" ]; then
|
||||
local found_home
|
||||
if found_home="$(find_wc_home)"; then
|
||||
WC_HOME="$found_home"
|
||||
export WC_HOME
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# =============================================================================
|
||||
# VALIDATION FUNCTIONS
|
||||
# =============================================================================
|
||||
|
||||
# Check if we're in a wild-cloud directory
|
||||
check_wild_directory() {
|
||||
local found_home
|
||||
if found_home="$(find_wc_home)"; then
|
||||
# Update WC_HOME if it's not set correctly
|
||||
if [ -z "${WC_HOME}" ] || [ "${WC_HOME}" != "$found_home" ]; then
|
||||
WC_HOME="$found_home"
|
||||
export WC_HOME
|
||||
fi
|
||||
else
|
||||
print_error "No wild-cloud project found in current directory or ancestors"
|
||||
print_info "Run 'wild-setup-scaffold' first to initialize a wild-cloud project"
|
||||
print_info "Current working directory: $(pwd)"
|
||||
local search_path="$(pwd)"
|
||||
while [ "$search_path" != "/" ]; do
|
||||
print_info " Searched: $search_path"
|
||||
search_path="$(dirname "$search_path")"
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Check if basic configuration exists
|
||||
check_basic_config() {
|
||||
if [ -z "$(get_current_config "operator.email")" ]; then
|
||||
print_error "Basic configuration is missing"
|
||||
print_info "Run 'wild-setup-scaffold' first to configure basic settings"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# =============================================================================
|
||||
# UTILITY FUNCTIONS
|
||||
# =============================================================================
|
||||
|
||||
# Check if a command exists
|
||||
command_exists() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# Check if a file exists and is readable
|
||||
file_readable() {
|
||||
[ -f "$1" ] && [ -r "$1" ]
|
||||
}
|
||||
|
||||
# Check if a directory exists and is writable
|
||||
dir_writable() {
|
||||
[ -d "$1" ] && [ -w "$1" ]
|
||||
}
|
||||
|
||||
# Generate a random string of specified length
|
||||
generate_random_string() {
|
||||
local length="${1:-32}"
|
||||
openssl rand -hex "$((length / 2))" 2>/dev/null || \
|
||||
head -c "$length" /dev/urandom | base64 | tr -d '=+/' | cut -c1-"$length"
|
||||
}
|
@@ -37,10 +37,13 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Check if WC_HOME is set
|
||||
if [ -z "${WC_HOME:-}" ]; then
|
||||
echo "Error: WC_HOME environment variable not set" >&2
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
CONFIG_FILE="${WC_HOME}/config.yaml"
|
||||
|
@@ -54,7 +54,6 @@ fi
|
||||
source_dir="$1"
|
||||
dest_dir="${2:-${source_dir}_compiled}"
|
||||
|
||||
|
||||
# Validate source directory
|
||||
if [[ ! -d "$source_dir" ]]; then
|
||||
echo "Error: Source directory does not exist: $source_dir" >&2
|
||||
|
@@ -49,10 +49,13 @@ if [ -z "${KEY_PATH}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if WC_HOME is set
|
||||
if [ -z "${WC_HOME:-}" ]; then
|
||||
echo "Error: WC_HOME environment variable not set" >&2
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
CONFIG_FILE="${WC_HOME}/config.yaml"
|
||||
|
@@ -57,10 +57,13 @@ if [ -z "${VALUE}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if WC_HOME is set
|
||||
if [ -z "${WC_HOME:-}" ]; then
|
||||
echo "Error: WC_HOME environment variable not set" >&2
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
CONFIG_FILE="${WC_HOME}/config.yaml"
|
||||
|
@@ -17,14 +17,15 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Check if WC_HOME is set
|
||||
if [ -z "${WC_HOME:-}" ]; then
|
||||
echo "Error: WC_HOME environment variable not set. Run \`source ./env.sh\`."
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
WC_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
# ---
|
||||
|
||||
SOURCE_DIR="${WC_ROOT}/setup/dnsmasq"
|
||||
|
@@ -49,10 +49,13 @@ if [ -z "${KEY_PATH}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if WC_HOME is set
|
||||
if [ -z "${WC_HOME:-}" ]; then
|
||||
echo "Error: WC_HOME environment variable not set" >&2
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
SECRETS_FILE="${WC_HOME}/secrets.yaml"
|
||||
|
@@ -57,10 +57,13 @@ if [ -z "${VALUE}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if WC_HOME is set
|
||||
if [ -z "${WC_HOME:-}" ]; then
|
||||
echo "Error: WC_HOME environment variable not set" >&2
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
SECRETS_FILE="${WC_HOME}/secrets.yaml"
|
||||
|
@@ -3,18 +3,12 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Source common utilities
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/wild-common.sh"
|
||||
# Parse arguments
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
init_wild_env
|
||||
|
||||
# Phase tracking variables
|
||||
SKIP_SCAFFOLD=false
|
||||
SKIP_CLUSTER=false
|
||||
SKIP_SERVICES=false
|
||||
|
||||
# Parse arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--skip-scaffold)
|
||||
@@ -71,31 +65,37 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Set up cloud directory (WC_HOME is where user's cloud will be)
|
||||
WC_HOME="$(pwd)"
|
||||
export WC_HOME
|
||||
# Initialize Wild-Cloud environment
|
||||
|
||||
print_header "Wild-Cloud Complete Setup"
|
||||
print_info "Running complete Wild-Cloud setup using modular components"
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
print_header "Wild-Cloud Setup"
|
||||
print_info "Running complete Wild-Cloud setup."
|
||||
echo ""
|
||||
|
||||
# =============================================================================
|
||||
# SCAFFOLD SETUP
|
||||
# WC_HOME SCAFFOLDING
|
||||
# =============================================================================
|
||||
|
||||
if [ "${SKIP_SCAFFOLD}" = false ]; then
|
||||
print_header "Component 1: Scaffold Setup"
|
||||
print_info "Running wild-setup-scaffold..."
|
||||
print_header "Cloud Home Setup"
|
||||
print_info "Scaffolding your cloud home..."
|
||||
|
||||
if wild-setup-scaffold; then
|
||||
print_success "Component 1 completed: Scaffold setup"
|
||||
print_success "Cloud home setup completed"
|
||||
else
|
||||
print_error "Component 1 failed: Scaffold setup"
|
||||
print_error "Cloud home setup failed"
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
else
|
||||
print_info "Skipping Component 1: Scaffold Setup"
|
||||
print_info "Skipping Component 1: Cloud Home Setup"
|
||||
fi
|
||||
|
||||
# =============================================================================
|
||||
@@ -103,13 +103,13 @@ fi
|
||||
# =============================================================================
|
||||
|
||||
if [ "${SKIP_CLUSTER}" = false ]; then
|
||||
print_header "Component 2: Cluster Setup"
|
||||
print_header "Cluster Setup"
|
||||
print_info "Running wild-setup-cluster..."
|
||||
|
||||
if wild-setup-cluster; then
|
||||
print_success "Component 2 completed: Cluster setup"
|
||||
print_success "Cluster setup completed"
|
||||
else
|
||||
print_error "Component 2 failed: Cluster setup"
|
||||
print_error "Cluster setup failed"
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
@@ -122,13 +122,13 @@ fi
|
||||
# =============================================================================
|
||||
|
||||
if [ "${SKIP_SERVICES}" = false ]; then
|
||||
print_header "Component 3: Services Setup"
|
||||
print_header "Services Setup"
|
||||
print_info "Running wild-setup-services..."
|
||||
|
||||
if wild-setup-services; then
|
||||
print_success "Component 3 completed: Services setup"
|
||||
print_success "Services setup completed"
|
||||
else
|
||||
print_error "Component 3 failed: Services setup"
|
||||
print_error "Services setup failed"
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
@@ -142,34 +142,6 @@ fi
|
||||
|
||||
print_header "Wild-Cloud Complete Setup Finished!"
|
||||
|
||||
print_success "All components completed successfully!"
|
||||
echo ""
|
||||
|
||||
print_info "What was accomplished:"
|
||||
if [ "${SKIP_SCAFFOLD}" = false ]; then
|
||||
print_info "✅ Component 1: Scaffold setup (cloud initialization)"
|
||||
else
|
||||
print_info "⏸️ Component 1: Scaffold setup (skipped)"
|
||||
fi
|
||||
|
||||
if [ "${SKIP_CLUSTER}" = false ]; then
|
||||
print_info "✅ Component 2: Cluster setup (Phases 1-3)"
|
||||
else
|
||||
print_info "⏸️ Component 2: Cluster setup (skipped)"
|
||||
fi
|
||||
|
||||
if [ "${SKIP_SERVICES}" = false ]; then
|
||||
print_info "✅ Component 3: Services setup (Phase 4)"
|
||||
else
|
||||
print_info "⏸️ Component 3: Services setup (skipped)"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
print_info "Individual components can be run separately:"
|
||||
echo " - wild-setup-scaffold # Cloud initialization"
|
||||
echo " - wild-setup-cluster # Cluster infrastructure"
|
||||
echo " - wild-setup-services # Cluster services"
|
||||
|
||||
echo ""
|
||||
if [ "${SKIP_SERVICES}" = false ] && command -v kubectl >/dev/null 2>&1; then
|
||||
if [ -f "${WC_HOME}/config.yaml" ]; then
|
||||
|
@@ -3,18 +3,12 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Source common utilities
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/wild-common.sh"
|
||||
# Parse arguments
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
init_wild_env
|
||||
|
||||
# Phase tracking variables
|
||||
SKIP_INSTALLER=false
|
||||
SKIP_HARDWARE=false
|
||||
SKIP_CONFIGS=false
|
||||
|
||||
# Parse arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--skip-installer)
|
||||
@@ -62,8 +56,15 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Check if we're in a wild-cloud directory
|
||||
check_wild_directory
|
||||
# Initialize Wild-Cloud environment
|
||||
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
# Check basic configuration
|
||||
check_basic_config
|
||||
@@ -103,25 +104,11 @@ if [ "${SKIP_HARDWARE}" = false ]; then
|
||||
GATEWAY_IP=$(ip route | grep default | awk '{print $3; exit}' 2>/dev/null || echo "192.168.1.1")
|
||||
SUBNET_PREFIX=$(echo "${CURRENT_IP}" | cut -d. -f1-3)
|
||||
|
||||
current_router_ip=$(get_current_config "cloud.router.ip")
|
||||
router_ip=$(prompt_with_default "Router/Gateway IP" "${GATEWAY_IP}" "${current_router_ip}")
|
||||
wild-config-set "cloud.router.ip" "${router_ip}"
|
||||
|
||||
current_dns_ip=$(get_current_config "cloud.dns.ip")
|
||||
dns_ip=$(prompt_with_default "DNS server IP (dnsmasq machine)" "${SUBNET_PREFIX}.50" "${current_dns_ip}")
|
||||
wild-config-set "cloud.dns.ip" "${dns_ip}"
|
||||
|
||||
current_dhcp_range=$(get_current_config "cloud.dhcpRange")
|
||||
dhcp_range=$(prompt_with_default "DHCP range for dnsmasq" "${SUBNET_PREFIX}.100,${SUBNET_PREFIX}.200" "${current_dhcp_range}")
|
||||
wild-config-set "cloud.dhcpRange" "${dhcp_range}"
|
||||
|
||||
current_interface=$(get_current_config "cloud.dnsmasq.interface")
|
||||
interface=$(prompt_with_default "Network interface for dnsmasq" "eth0" "${current_interface}")
|
||||
wild-config-set "cloud.dnsmasq.interface" "${interface}"
|
||||
|
||||
current_external_resolver=$(get_current_config "cloud.dns.externalResolver")
|
||||
external_resolver=$(prompt_with_default "External DNS resolver" "1.1.1.1" "${current_external_resolver}")
|
||||
wild-config-set "cloud.dns.externalResolver" "${external_resolver}"
|
||||
prompt_if_unset_config "cloud.router.ip" "Router/Gateway IP" "${GATEWAY_IP}"
|
||||
prompt_if_unset_config "cloud.dns.ip" "DNS server IP (dnsmasq machine)" "${SUBNET_PREFIX}.50"
|
||||
prompt_if_unset_config "cloud.dhcpRange" "DHCP range for dnsmasq" "${SUBNET_PREFIX}.100,${SUBNET_PREFIX}.200"
|
||||
prompt_if_unset_config "cloud.dnsmasq.interface" "Network interface for dnsmasq" "eth0"
|
||||
prompt_if_unset_config "cloud.dns.externalResolver" "External DNS resolver" "1.1.1.1"
|
||||
|
||||
print_success "Network configuration completed"
|
||||
echo ""
|
||||
@@ -134,24 +121,14 @@ if [ "${SKIP_HARDWARE}" = false ]; then
|
||||
SUBNET_PREFIX=$(echo "${CURRENT_IP}" | cut -d. -f1-3)
|
||||
|
||||
# Talos version
|
||||
current_talos_version=$(get_current_config "cluster.nodes.talos.version")
|
||||
if [ -z "$current_talos_version" ] || [ "$current_talos_version" = "null" ]; then
|
||||
talos_version=$(prompt_with_default "Talos version" "v1.10.4" "${current_talos_version}")
|
||||
wild-config-set "cluster.nodes.talos.version" "${talos_version}"
|
||||
else
|
||||
talos_version="$current_talos_version"
|
||||
fi
|
||||
prompt_if_unset_config "cluster.nodes.talos.version" "Talos version" "v1.10.4"
|
||||
talos_version=$(wild-config "cluster.nodes.talos.version")
|
||||
|
||||
# MetalLB IP address pool
|
||||
current_ip_pool=$(get_current_config "cluster.ipAddressPool")
|
||||
if [ -z "$current_ip_pool" ] || [ "$current_ip_pool" = "null" ]; then
|
||||
ip_pool=$(prompt_with_default "MetalLB IP address pool" "${SUBNET_PREFIX}.80-${SUBNET_PREFIX}.89" "${current_ip_pool}")
|
||||
wild-config-set "cluster.ipAddressPool" "${ip_pool}"
|
||||
else
|
||||
ip_pool="$current_ip_pool"
|
||||
fi
|
||||
prompt_if_unset_config "cluster.ipAddressPool" "MetalLB IP address pool" "${SUBNET_PREFIX}.80-${SUBNET_PREFIX}.89"
|
||||
ip_pool=$(wild-config "cluster.ipAddressPool")
|
||||
|
||||
# Load balancer IP (automatically set to first address in the pool)
|
||||
# Load balancer IP (automatically set to first address in the pool if not set)
|
||||
current_lb_ip=$(get_current_config "cluster.loadBalancerIp")
|
||||
if [ -z "$current_lb_ip" ] || [ "$current_lb_ip" = "null" ]; then
|
||||
lb_ip=$(echo "${ip_pool}" | cut -d'-' -f1)
|
||||
@@ -183,12 +160,8 @@ if [ "${SKIP_HARDWARE}" = false ]; then
|
||||
fi
|
||||
|
||||
# External DNS
|
||||
current_owner_id=$(get_current_config "cluster.externalDns.ownerId")
|
||||
if [ -z "$current_owner_id" ] || [ "$current_owner_id" = "null" ]; then
|
||||
cluster_name=$(get_current_config "cluster.name")
|
||||
owner_id=$(prompt_with_default "External DNS owner ID" "external-dns-${cluster_name}" "${current_owner_id}")
|
||||
wild-config-set "cluster.externalDns.ownerId" "${owner_id}"
|
||||
fi
|
||||
cluster_name=$(get_current_config "cluster.name")
|
||||
prompt_if_unset_config "cluster.externalDns.ownerId" "External DNS owner ID" "external-dns-${cluster_name}"
|
||||
|
||||
print_success "Cluster configuration completed"
|
||||
echo ""
|
||||
@@ -208,9 +181,8 @@ if [ "${SKIP_HARDWARE}" = false ]; then
|
||||
print_info "Configure control plane nodes (you need at least 3 for HA):"
|
||||
echo ""
|
||||
|
||||
current_vip=$(get_current_config "cluster.nodes.control.vip")
|
||||
vip=$(prompt_with_default "Control plane virtual IP" "${SUBNET_PREFIX}.90" "${current_vip}")
|
||||
wild-config-set "cluster.nodes.control.vip" "${vip}"
|
||||
prompt_if_unset_config "cluster.nodes.control.vip" "Control plane virtual IP" "${SUBNET_PREFIX}.90"
|
||||
vip=$(wild-config "cluster.nodes.control.vip")
|
||||
|
||||
# Automatically configure the first three IPs after VIP for control plane nodes
|
||||
vip_last_octet=$(echo "$vip" | cut -d. -f4)
|
||||
|
@@ -3,15 +3,11 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Source common utilities
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/wild-common.sh"
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
init_wild_env
|
||||
# Parse arguments
|
||||
|
||||
UPDATE=false
|
||||
|
||||
# Parse arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--update)
|
||||
@@ -52,19 +48,18 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Set up cloud directory (WC_HOME is where user's cloud will be)
|
||||
WC_HOME="$(pwd)"
|
||||
export WC_HOME
|
||||
# Initialize Wild-Cloud environment
|
||||
|
||||
# Template directory (in WC_ROOT, never written to)
|
||||
TEMPLATE_DIR="${WC_ROOT}/setup/home-scaffold"
|
||||
echo "Using template directory: ${TEMPLATE_DIR}"
|
||||
|
||||
if [ ! -d "${TEMPLATE_DIR}" ]; then
|
||||
echo "Error: Template directory not found at ${TEMPLATE_DIR}"
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
TEMPLATE_DIR="${WC_ROOT}/setup/home-scaffold"
|
||||
|
||||
# Check if cloud already exists
|
||||
if [ -d ".wildcloud" ]; then
|
||||
echo "Wild-Cloud already exists in this directory."
|
||||
@@ -164,27 +159,26 @@ if [ ! -f "${WC_HOME}/config.yaml" ] || [ -z "$(get_current_config "operator.ema
|
||||
echo ""
|
||||
|
||||
# Basic Information
|
||||
current_email=$(get_current_config "operator.email")
|
||||
email=$(prompt_with_default "Your email address (for Let's Encrypt certificates)" "" "${current_email}")
|
||||
wild-config-set "operator.email" "${email}"
|
||||
prompt_if_unset_config "operator.email" "Your email address (for Let's Encrypt certificates)" ""
|
||||
|
||||
# Domain Configuration
|
||||
current_base_domain=$(get_current_config "cloud.baseDomain")
|
||||
base_domain=$(prompt_with_default "Your base domain name (e.g., example.com)" "" "${current_base_domain}")
|
||||
wild-config-set "cloud.baseDomain" "${base_domain}"
|
||||
prompt_if_unset_config "cloud.baseDomain" "Your base domain name (e.g., example.com)" ""
|
||||
|
||||
# Get base domain to use as default for cloud domain
|
||||
base_domain=$(wild-config "cloud.baseDomain")
|
||||
prompt_if_unset_config "cloud.domain" "Your public cloud domain" "cloud.${base_domain}"
|
||||
|
||||
# Get cloud domain to use as default for internal domain
|
||||
domain=$(wild-config "cloud.domain")
|
||||
prompt_if_unset_config "cloud.internalDomain" "Your internal cloud domain" "internal.${domain}"
|
||||
|
||||
current_domain=$(get_current_config "cloud.domain")
|
||||
domain=$(prompt_with_default "Your public cloud domain" "cloud.${base_domain}" "${current_domain}")
|
||||
wild-config-set "cloud.domain" "${domain}"
|
||||
|
||||
current_internal_domain=$(get_current_config "cloud.internalDomain")
|
||||
internal_domain=$(prompt_with_default "Your internal cloud domain" "internal.${domain}" "${current_internal_domain}")
|
||||
wild-config-set "cloud.internalDomain" "${internal_domain}"
|
||||
|
||||
# Derive cluster name from domain
|
||||
cluster_name=$(echo "${domain}" | tr '.' '-' | tr '[:upper:]' '[:lower:]')
|
||||
wild-config-set "cluster.name" "${cluster_name}"
|
||||
print_info "Set cluster name to: ${cluster_name}"
|
||||
# Derive cluster name from domain if not already set
|
||||
current_cluster_name=$(get_current_config "cluster.name")
|
||||
if [ -z "$current_cluster_name" ] || [ "$current_cluster_name" = "null" ]; then
|
||||
cluster_name=$(echo "${domain}" | tr '.' '-' | tr '[:upper:]' '[:lower:]')
|
||||
wild-config-set "cluster.name" "${cluster_name}"
|
||||
print_info "Set cluster name to: ${cluster_name}"
|
||||
fi
|
||||
|
||||
print_success "Basic configuration completed"
|
||||
echo ""
|
||||
|
@@ -3,13 +3,8 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Source common utilities
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/wild-common.sh"
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
init_wild_env
|
||||
|
||||
# Parse arguments
|
||||
|
||||
SKIP_INSTALL=false
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
@@ -53,8 +48,15 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Check if we're in a wild-cloud directory
|
||||
check_wild_directory
|
||||
# Initialize Wild-Cloud environment
|
||||
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
# Check basic configuration
|
||||
check_basic_config
|
||||
|
@@ -5,10 +5,13 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Check if WC_HOME is set
|
||||
if [ -z "${WC_HOME:-}" ]; then
|
||||
echo "Error: WC_HOME environment variable not set. Run \`source .env\`."
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
CONFIG_FILE="${WC_HOME}/config.yaml"
|
||||
|
@@ -6,10 +6,13 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Check if WC_HOME is set
|
||||
if [ -z "${WC_HOME:-}" ]; then
|
||||
echo "Error: WC_HOME environment variable not set. Run \`source .env\`."
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
CONFIG_FILE="${WC_HOME}/config.yaml"
|
||||
|
Reference in New Issue
Block a user