nxtgauge-backend-rust/scripts/deploy-smtp-test111.sh
Ashwin Kumar Sivakumar f7d0f6f9f5
Some checks failed
build-and-release / build (companies) (push) Failing after 39s
build-and-release / build (catering-services) (push) Failing after 57s
build-and-release / build (cron) (push) Failing after 1m4s
build-and-release / build (gateway) (push) Successful in 3m46s
build-and-release / build (fitness-trainers) (push) Successful in 9m8s
build-and-release / build (graphic-designers) (push) Successful in 8m58s
build-and-release / build (employees) (push) Successful in 9m17s
build-and-release / build (customers) (push) Successful in 9m47s
build-and-release / build (developers) (push) Successful in 9m48s
build-and-release / build (job-seekers) (push) Successful in 9m1s
build-and-release / build (jobs) (push) Successful in 4m17s
build-and-release / build (leads) (push) Successful in 8m23s
build-and-release / build (makeup-artists) (push) Successful in 8m40s
build-and-release / build (payments) (push) Successful in 9m21s
build-and-release / build (photographers) (push) Successful in 9m20s
build-and-release / build (social-media-managers) (push) Successful in 8m9s
build-and-release / build (tutors) (push) Successful in 8m16s
build-and-release / build (ugc-content-creators) (push) Successful in 6m59s
build-and-release / build (video-editors) (push) Successful in 6m9s
build-and-release / build (users) (push) Successful in 8m37s
fix: Update Dockerfiles to use ci.nxtgauge.com registry
2026-07-08 03:37:18 +05:30

107 lines
3.3 KiB
Bash
Executable file

#!/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 <<EOF | kubectl apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
name: $CONFIGMAP_NAME
namespace: $NAMESPACE
data:
EMAIL_PROVIDER: "SMTP"
SMTP_HOST: "smtp.zeptomail.in"
SMTP_PORT: "587"
SMTP_USER: "emailapikey"
SMTP_FROM_EMAIL: "support@nxtgauge.com"
SMTP_FROM_NAME: "NXTGAUGE"
SMTP_SECURE: "true"
FRONTEND_URL: "https://test111.nxtgauge.com"
ADMIN_URL: "https://admin.test111.nxtgauge.com"
EOF
echo -e "${GREEN}✓ ConfigMap updated${NC}"
echo ""
echo -e "${YELLOW}Step 4: Creating/updating Secret with SMTP credentials...${NC}"
# ZeptoMail credentials
SMTP_PASS="PHtE6r1ZR+zi3jV88RNW4/O4F8CkPdksqO9iJAhA4YcTD6dQFk1S+dl/wDC3/h97AKYWFfSczo1rt72etOuDLTnrMjlEDWqyqK3sx/VYSPOZsbq6x00esVgYdEfYVYDpcNFj3SPQut7dNA=="
# Prompt for Demo account emails
read -p "Enter Demo Account Emails (comma-separated, press Enter for default): " DEMO_EMAILS
DEMO_EMAILS=${DEMO_EMAILS:-"test@example.com,demo@nxtgauge.com"}
# Create Secret
kubectl create secret generic "$SECRET_NAME" \
--namespace="$NAMESPACE" \
--from-literal=SMTP_PASS="$SMTP_PASS" \
--from-literal=DEMO_ACCOUNT_EMAILS="$DEMO_EMAILS" \
--dry-run=client -o yaml | kubectl apply -f -
echo "✓ SMTP credentials configured (ZeptoMail)"
echo -e "${GREEN}✓ Secret updated${NC}"
echo ""
echo -e "${YELLOW}Step 5: Restarting deployment to apply changes...${NC}"
kubectl rollout restart deployment/$DEPLOYMENT_NAME -n $NAMESPACE
echo -e "${GREEN}✓ Deployment restarted${NC}"
echo ""
echo -e "${YELLOW}Step 6: Waiting for rollout to complete...${NC}"
if kubectl rollout status deployment/$DEPLOYMENT_NAME -n $NAMESPACE --timeout=120s; then
echo -e "${GREEN}✓ Rollout completed successfully${NC}"
else
echo -e "${RED}Warning: Rollout may not have completed within timeout${NC}"
fi
echo ""
echo "=== Setup Complete ==="
echo ""
echo "Email verification is now: ENABLED"
echo "SMTP Provider: ZeptoMail (smtp.zeptomail.in)"
echo "Demo Accounts (bypass verification): $DEMO_EMAILS"
echo ""
echo "To verify email is working, check logs:"
echo " kubectl logs -f deployment/$DEPLOYMENT_NAME -n $NAMESPACE | grep -i email"