-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cursorrules
158 lines (141 loc) · 5.08 KB
/
.cursorrules
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Scaffold Toolkit Installer Script
1. Core Features
- Interactive Prompts:
- Prompt users to select:
1. Scaffold Type:
- DrevOps (available)
- Vortex (coming soon)
- GovCMS PaaS (coming soon)
2. CI/CD Integration:
- CircleCI (available)
- GitHub Actions (coming soon)
2.1. SSH Key MD5 Hash (if CircleCI selected)
3. Hosting Environment:
- Lagoon
- Acquia
4. Scripts and .twig_cs.php Update
5. Final Review of Changes
6. Installation Summary
- File-specific questions will include:
- Whether to override an existing file based on detected version differences.
- Initial installations will provide contextual prompts if version metadata is missing.
- Versioning Metadata:
- All scaffold files will include metadata such as:
```
# Version: 1.0.0
# Customized: false
```
2. Installation Process
- Source Directory Handling:
- Files are pulled from GitHub by default
- Local files used only for testing (with --use-local-files)
- Target directory for installations can be specified (default: '.')
- Directory structure is automatically created
- File Processing:
- Version checking for existing files
- Non-interactive mode for automated installations
- Proper error handling and reporting
- GitHub download error handling
- Automatic execute permissions for .sh files
3. Testing Environment
- Docker-based Testing:
- Uses Lagoon PHP 8.3 CLI image
- Source code is copied to /source during build
- Tests run in /workspace directory
- Each test gets a clean environment
- Uses local files instead of GitHub
- Test Matrix:
- Scaffold Types:
- DrevOps (available)
- Vortex (coming soon)
- GovCMS PaaS (coming soon)
- CI/CD Types:
- CircleCI (available)
- GitHub Actions (coming soon)
- Hosting Types:
- Lagoon
- Acquia
- Installation Types:
- Normal installation
- Force installation
- Test Process:
- Clean environment before each test
- Run installation with --use-local-files
- Show directory contents
- Clean up after test
- Colored output for pass/fail status
4. Project Structure
```
.
├── ci/
│ ├── circleci/ # CircleCI configuration
│ │ ├── acquia/ # Acquia-specific config
│ │ └── lagoon/ # Lagoon-specific config
│ └── gha/ # GitHub Actions (coming soon)
│ ├── acquia/ # Acquia-specific config
│ └── lagoon/ # Lagoon-specific config
├── scripts/ # Scripts directory
├── renovatebot/
│ ├── drupal/ # Drupal-specific Renovate config
│ │ └── renovate.json
│ └── govcms_paas/ # GovCMS PaaS Renovate config
│ └── renovate.json
├── scaffold-installer.php # Main installer script
├── Dockerfile.test # Testing environment setup
├── docker-compose.test.yml # Docker Compose configuration
└── .ahoy.yml # Ahoy commands for testing
```
5. Command Line Options
```bash
php scaffold-installer.php [options]
Options:
--scaffold=<type> Select scaffold type (drevops|vortex|govcms)
--latest Use latest version
--version=<tag> Use specific version
--force Overwrite existing files
--ci=<type> Select CI/CD type (circleci|github)
--hosting=<type> Select hosting (lagoon|acquia)
--source-dir=<path> Source directory for files
--target-dir=<path> Target directory for installation
--non-interactive Run without prompts
--use-local-files Use local files instead of GitHub
--github-repo Custom GitHub repository
--github-branch Custom GitHub branch
--distribution Distribution type (drupal|govcms_paas)
--ssh-fingerprint SSH key fingerprint for CircleCI
```
6. Testing Commands
```bash
# Start testing environment
ahoy up
# Run all tests
ahoy test
# Stop and clean environment
ahoy down
```
7. Test Output Format
```
Running test: Install - drevops with circleci and lagoon
✓ Test passed: Install - drevops with circleci and lagoon
Test directory contents for Install - drevops with circleci and lagoon:
.circleci/
└── config.yml
renovate.json
```
8. Error Handling
- Proper error messages for missing files
- Validation of source and target directories
- Exit codes for test failures
- Colored output for errors and successes
- GitHub download error handling
- cURL error handling for GitHub requests
9. Development Guidelines
- Keep source files versioned
- Add tests for new features
- Clean up test environment between runs
- Use non-interactive mode for CI/CD
- Follow Drupal coding standards
- Test both GitHub and local file modes
# File version tracking
Aleays increment version in the installer script and in this file.
scaffold-installer.php=1.0.16