-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-ddev.sh
More file actions
executable file
Β·137 lines (112 loc) Β· 3.95 KB
/
test-ddev.sh
File metadata and controls
executable file
Β·137 lines (112 loc) Β· 3.95 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
# DDEV Testing Script for Laravel Model Schema Checker
# This will help you test the package using DDEV before publishing
echo "π Laravel Model Schema Checker - DDEV Test"
echo "==========================================="
# Check if DDEV is available
if ! command -v ddev &> /dev/null; then
echo "β Error: DDEV is not installed or not in PATH"
echo "Please install DDEV: https://ddev.readthedocs.io/en/latest/users/install/"
exit 1
fi
# Check if we're in the right directory
if [ ! -f "composer.json" ] || [ ! -d "src" ]; then
echo "β Error: Please run this from the laravel-model-schema-checker root directory"
exit 1
fi
echo "π Step 1: Testing Package Structure..."
if [ -f "src/ModelSchemaCheckerServiceProvider.php" ]; then
echo "β
Service Provider exists"
else
echo "β Service Provider missing"
exit 1
fi
echo "π Step 2: Starting DDEV..."
ddev start
if [ $? -ne 0 ]; then
echo "β Failed to start DDEV"
exit 1
fi
echo "β
DDEV started successfully"
echo "π Step 3: Composer Validation..."
ddev composer validate --no-check-all --strict
if [ $? -eq 0 ]; then
echo "β
composer.json is valid"
else
echo "β composer.json has issues"
exit 1
fi
echo "π Step 4: Creating Test Laravel Project..."
ddev exec rm -rf /tmp/test-laravel-project
ddev exec bash -c "cd /tmp && composer create-project laravel/laravel test-laravel-project --prefer-dist --no-progress --quiet"
if [ $? -ne 0 ]; then
echo "β Failed to create Laravel project"
exit 1
fi
echo "β
Laravel project created in /tmp"
echo "π Step 5: Installing Package Locally..."
# Add local repository and install package via DDEV
ddev exec bash -c "cd /tmp/test-laravel-project && composer config repositories.local path /var/www/html"
ddev exec bash -c "cd /tmp/test-laravel-project && composer require ndestates/laravel-model-schema-checker *@dev --quiet"
if [ $? -ne 0 ]; then
echo "β Failed to install package"
exit 1
fi
echo "β
Package installed successfully"
echo "π Step 6: Setting up Laravel..."
# Copy environment file and generate key
ddev exec bash -c "cd /tmp/test-laravel-project && cp .env.example .env"
ddev exec bash -c "cd /tmp/test-laravel-project && php artisan key:generate --no-interaction"
if [ $? -ne 0 ]; then
echo "β Failed to setup Laravel"
exit 1
fi
echo "β
Laravel configured"
echo "π Step 7: Testing Package Commands..."
# Test basic help
ddev exec bash -c "cd /tmp/test-laravel-project && php artisan model:schema-check --help"
if [ $? -eq 0 ]; then
echo "β
Help command works"
else
echo "β Help command failed"
exit 1
fi
# Test Laravel integration
ddev exec bash -c "cd /tmp/test-laravel-project && php artisan --version"
if [ $? -eq 0 ]; then
echo "β
Laravel is working"
else
echo "β Laravel integration failed"
exit 1
fi
echo ""
echo "π SUCCESS! Package development testing completed"
echo ""
echo "π DDEV URLs:"
echo "- Web: https://laravel-model-schema-checker.ddev.site"
echo "- Mailpit: https://laravel-model-schema-checker.ddev.site:8026"
echo ""
echo "π Manual Testing Commands (run these in the test project):"
echo "ddev ssh"
echo "cd /tmp/test-laravel-project"
echo "php artisan model:schema-check --dry-run"
echo ""
echo "οΏ½ Development Status - Version 3.0 (IN DEVELOPMENT):"
echo "β’ Core functionality: β
Implemented"
echo "β’ Migration safety features: β
Implemented"
echo "β’ Backup/rollback features: β
Implemented"
echo "β’ Testing: β
In progress"
echo "β’ Documentation: β³ Pending"
echo "β’ Publishing: β Not ready"
echo ""
echo "π Next Development Steps:"
echo "1. Complete comprehensive testing"
echo "2. Update VERSION_3_PLAN.md with completion status"
echo "3. Write documentation and usage examples"
echo "4. Final integration testing"
echo "5. Code review and optimization"
echo "6. THEN prepare for publishing as v3.0.0"
echo ""
# Go back to project root
cd ..
echo "π‘ Tip: Run 'ddev stop' when done testing"