Skip to content

Commit 238814f

Browse files
feat: add deployment test script for validation without actual deployment
1 parent 880b6ff commit 238814f

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

scripts/test-deploy.ps1

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Test Deployment Script
2+
# Purpose: Tests the deployment process without actually deploying
3+
4+
# Load GitHub username from config
5+
$githubUsername = Get-Content -Path "github-config.txt" -TotalCount 1
6+
7+
Write-Output "==== DEPLOYMENT TEST MODE ===="
8+
Write-Output "GitHub Username: $githubUsername"
9+
Write-Output "Repository: elmentor-landing-page-clean"
10+
Write-Output "Target URL: https://$githubUsername.github.io/elmentor-landing-page-clean/"
11+
12+
Write-Output "`n==== VALIDATING CONFIGURATION ===="
13+
14+
# Check if git is available
15+
try {
16+
$gitVersion = git --version
17+
Write-Output "✓ Git is available: $gitVersion"
18+
} catch {
19+
Write-Output "✗ Git is not available in PATH. Please install Git."
20+
exit 1
21+
}
22+
23+
# Check if npm is available
24+
try {
25+
$npmVersion = npm --version
26+
Write-Output "✓ npm is available: v$npmVersion"
27+
} catch {
28+
Write-Output "✗ npm is not available in PATH. Please install Node.js."
29+
exit 1
30+
}
31+
32+
# Check if package.json exists
33+
if (Test-Path "package.json") {
34+
Write-Output "✓ package.json found"
35+
} else {
36+
Write-Output "✗ package.json not found. Are you in the correct directory?"
37+
exit 1
38+
}
39+
40+
# Check if the build script exists in package.json
41+
$packageJson = Get-Content -Path "package.json" | ConvertFrom-Json
42+
if ($packageJson.scripts.build) {
43+
Write-Output "✓ Build script found in package.json"
44+
} else {
45+
Write-Output "✗ Build script not found in package.json."
46+
exit 1
47+
}
48+
49+
Write-Output "`n==== TEST BUILD SIMULATION ===="
50+
Write-Output "Would execute: npm run build"
51+
Write-Output "This would generate the static site in the /dist directory"
52+
53+
Write-Output "`n==== TEST DEPLOYMENT SIMULATION ===="
54+
Write-Output "Would execute: npx gh-pages -d dist -r https://github.com/$githubUsername/elmentor-landing-page-clean.git"
55+
Write-Output "This would deploy the /dist directory to GitHub Pages"
56+
57+
Write-Output "`n==== TEST COMPLETE ===="
58+
Write-Output "Deployment test successful! In a real deployment, your site would be live at:"
59+
Write-Output "https://$githubUsername.github.io/elmentor-landing-page-clean/"

0 commit comments

Comments
 (0)