|
@ -174,9 +174,9 @@ validate_env_vars() { |
|
|
# Function to set environment variables for different build types |
|
|
# Function to set environment variables for different build types |
|
|
setup_build_env() { |
|
|
setup_build_env() { |
|
|
local build_type="$1" |
|
|
local build_type="$1" |
|
|
local production="${2:-false}" |
|
|
local build_mode="${2:-development}" |
|
|
|
|
|
|
|
|
log_info "Setting up environment for $build_type build" |
|
|
log_info "Setting up environment for $build_type build (mode: $build_mode)" |
|
|
|
|
|
|
|
|
# Get git hash for versioning |
|
|
# Get git hash for versioning |
|
|
local git_hash=$(get_git_hash) |
|
|
local git_hash=$(get_git_hash) |
|
@ -204,19 +204,19 @@ setup_build_env() { |
|
|
esac |
|
|
esac |
|
|
|
|
|
|
|
|
# Set API server environment variables based on build mode |
|
|
# Set API server environment variables based on build mode |
|
|
if [ "$BUILD_MODE" = "development" ]; then |
|
|
if [ "$build_mode" = "development" ]; then |
|
|
# For Capacitor development, use localhost by default |
|
|
# For Capacitor development, use localhost by default |
|
|
# Android builds will override this in build-android.sh |
|
|
# Android builds will override this in build-android.sh |
|
|
export VITE_DEFAULT_ENDORSER_API_SERVER="http://localhost:3000" |
|
|
export VITE_DEFAULT_ENDORSER_API_SERVER="http://localhost:3000" |
|
|
export VITE_DEFAULT_PARTNER_API_SERVER="http://localhost:3000" |
|
|
export VITE_DEFAULT_PARTNER_API_SERVER="http://localhost:3000" |
|
|
log_debug "Development mode: Using localhost for Endorser and Partner APIs" |
|
|
log_debug "Development mode: Using localhost for Endorser and Partner APIs" |
|
|
export VITE_DEFAULT_IMAGE_API_SERVER="https://image-api.timesafari.app" |
|
|
export VITE_DEFAULT_IMAGE_API_SERVER="https://image-api.timesafari.app" |
|
|
elif [ "$BUILD_MODE" = "test" ]; then |
|
|
elif [ "$build_mode" = "test" ]; then |
|
|
export VITE_DEFAULT_ENDORSER_API_SERVER="https://test-api.endorser.ch" |
|
|
export VITE_DEFAULT_ENDORSER_API_SERVER="https://test-api.endorser.ch" |
|
|
export VITE_DEFAULT_PARTNER_API_SERVER="https://test-partner-api.endorser.ch" |
|
|
export VITE_DEFAULT_PARTNER_API_SERVER="https://test-partner-api.endorser.ch" |
|
|
log_debug "Test mode: Using test Endorser and Partner APIs" |
|
|
log_debug "Test mode: Using test Endorser and Partner APIs" |
|
|
export VITE_DEFAULT_IMAGE_API_SERVER="https://image-api.timesafari.app" |
|
|
export VITE_DEFAULT_IMAGE_API_SERVER="https://image-api.timesafari.app" |
|
|
elif [ "$BUILD_MODE" = "production" ]; then |
|
|
elif [ "$build_mode" = "production" ]; then |
|
|
export VITE_DEFAULT_ENDORSER_API_SERVER="https://api.endorser.ch" |
|
|
export VITE_DEFAULT_ENDORSER_API_SERVER="https://api.endorser.ch" |
|
|
export VITE_DEFAULT_PARTNER_API_SERVER="https://partner-api.endorser.ch" |
|
|
export VITE_DEFAULT_PARTNER_API_SERVER="https://partner-api.endorser.ch" |
|
|
log_debug "Production mode: Using production API servers" |
|
|
log_debug "Production mode: Using production API servers" |
|
|