#!/bin/bash # Deploy environment variables to test111.nxtgauge.com # This script updates the Kubernetes ConfigMap or Docker environment set -e echo "=== Nxtgauge Test111 Environment Setup ===" echo "" # Configuration NAMESPACE="nxtgauge" CONFIGMAP_NAME="nxtgauge-config" SECRET_NAME="nxtgauge-secrets" DEPLOYMENT_NAME="nxtgauge-rust-gateway" # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # No Color echo -e "${YELLOW}Step 1: Checking kubectl access...${NC}" if ! kubectl cluster-info > /dev/null 2>&1; then echo -e "${RED}Error: Cannot connect to Kubernetes cluster${NC}" echo "Please ensure:" echo " 1. kubectl is installed" echo " 2. You have access to the test111 cluster" echo " 3. Your kubeconfig is properly set up" exit 1 fi echo -e "${GREEN}✓ Kubernetes cluster accessible${NC}" echo "" echo -e "${YELLOW}Step 2: Checking namespace...${NC}" if ! kubectl get namespace "$NAMESPACE" > /dev/null 2>&1; then echo -e "${RED}Error: Namespace '$NAMESPACE' not found${NC}" exit 1 fi echo -e "${GREEN}✓ Namespace '$NAMESPACE' exists${NC}" echo "" echo -e "${YELLOW}Step 3: Creating/updating ConfigMap with SMTP settings...${NC}" # Create ConfigMap with SMTP configuration cat <