forked from Aditya-Karmalkar/RAKTDAAN
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-check.js
More file actions
73 lines (60 loc) · 2.27 KB
/
deploy-check.js
File metadata and controls
73 lines (60 loc) · 2.27 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env node
// Simple deployment verification script
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
console.log('🚀 Raktdaan Netlify Deployment Verification\n');
// Check if dist folder exists
const distPath = path.join(__dirname, 'dist');
if (!fs.existsSync(distPath)) {
console.error('❌ Error: dist folder not found. Run "npm run build" first.');
process.exit(1);
}
// Check if index.html exists in dist
const indexPath = path.join(distPath, 'index.html');
if (!fs.existsSync(indexPath)) {
console.error('❌ Error: index.html not found in dist folder.');
process.exit(1);
}
// Check required environment variables for production
const requiredEnvVars = [
'VITE_CONVEX_URL',
'VITE_FIREBASE_API_KEY',
'VITE_FIREBASE_PROJECT_ID'
];
console.log('📋 Checking environment variables:');
let missingVars = [];
requiredEnvVars.forEach(varName => {
if (process.env[varName]) {
console.log(`✅ ${varName}: ${process.env[varName].substring(0, 20)}...`);
} else {
console.log(`❌ ${varName}: Not set`);
missingVars.push(varName);
}
});
if (missingVars.length > 0) {
console.log('\n⚠️ Warning: Missing environment variables. Make sure to set these in Netlify:');
missingVars.forEach(varName => console.log(` - ${varName}`));
}
// Check if netlify.toml exists
const netlifyTomlPath = path.join(__dirname, 'netlify.toml');
if (fs.existsSync(netlifyTomlPath)) {
console.log('✅ netlify.toml configuration found');
} else {
console.log('❌ netlify.toml not found');
}
// Check if _redirects exists
const redirectsPath = path.join(__dirname, 'public', '_redirects');
if (fs.existsSync(redirectsPath)) {
console.log('✅ SPA redirects configured');
} else {
console.log('❌ _redirects file not found');
}
console.log('\n🎯 Production URL: (Set via VITE_CONVEX_URL environment variable)');
console.log('\n📚 Next steps:');
console.log('1. Set environment variables in Netlify dashboard');
console.log('2. Deploy using: netlify deploy --prod');
console.log('3. Or connect your Git repository to Netlify');
console.log('\n✅ Ready for deployment!');