-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate-env.sh
More file actions
52 lines (43 loc) · 1.59 KB
/
Copy pathvalidate-env.sh
File metadata and controls
52 lines (43 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# Validation script to check if environment variables are properly set
# Run this script to verify your environment setup before starting the application
echo "🔍 Checking RHODA Frontend Environment Setup..."
echo "================================================"
# Check if .env file exists
if [ -f ".env" ]; then
echo "✅ .env file found"
else
echo "❌ .env file not found"
echo " Run: cp .env.example .env"
echo " Then edit .env with your actual Camunda credentials"
exit 1
fi
# Check required environment variables
REQUIRED_VARS=("CAMUNDA_CLIENT_ID" "CAMUNDA_CLIENT_SECRET" "CAMUNDA_CLUSTER_ID" "CAMUNDA_REGION")
MISSING_VARS=()
for var in "${REQUIRED_VARS[@]}"; do
if [ -z "${!var}" ]; then
MISSING_VARS+=("$var")
fi
done
if [ ${#MISSING_VARS[@]} -eq 0 ]; then
echo "✅ All required environment variables are set"
# Validate credential format (basic check)
if [[ ${#CAMUNDA_CLIENT_ID} -gt 20 && ${#CAMUNDA_CLIENT_SECRET} -gt 40 && ${#CAMUNDA_CLUSTER_ID} -gt 30 ]]; then
echo "✅ Credential format looks valid"
else
echo "⚠️ Warning: Some credentials appear to be placeholders"
echo " Make sure you've replaced template values with real credentials"
fi
echo ""
echo "🚀 Environment setup complete!"
echo " You can now run: mvn spring-boot:run"
else
echo "❌ Missing required environment variables:"
for var in "${MISSING_VARS[@]}"; do
echo " - $var"
done
echo ""
echo "Please set these variables in your .env file or system environment"
exit 1
fi