Insights:Testing and Deployment Workflow: Tools and Commands Ready to Reuse
Five Steps
| Order | Action | Purpose |
|---|---|---|
| 1 | Backup | For rollback |
| 2 | Upload changed files | Deployment |
| 3 | Clear cache | Take effect |
| 4 | Smoke test | Verification |
| 5 | Record version | Traceability |
1. Backup
- Backup the files to be overwritten.
- Backup the database (if there are structural changes).
- Include date and version in the backup filename.
2. Upload
- Only upload changed files, not a full overwrite.
- Maintain directory structure.
- Verify file size or checksum after upload.
3. Clear Cache
- Handle page cache, template cache, and OPcache separately.
- Confirm results after clearing.
4. Smoke Test
The minimum five checks:
- Homepage is accessible.
- A detail page is accessible.
- Forms can be submitted.
- Admin panel login works.
- Key internal links are reachable.
5. Record Version
- Record publish time, version number, change summary, and operator.
- Write in a fixed location (e.g., a specific admin page or standalone file).
A Minimal Release Script Concept
Backup → Upload → Clear cache → Smoke test → Record
If any step fails, stop immediately and do not proceed further.
How to Roll Back
- Overwrite with the backup from Step 1.
- Clear cache.
- Repeat smoke testing.
- Document the rollback reason.
Common Issues
- Forgetting to clear cache after upload.
- Placing backups in the same directory, so they’re lost together when overwritten.
- Running smoke tests only on the homepage.
- Recording version updates with a single message in chat.
Boundaries
The above is organized based on traditional file-based deployment. When using containers or version-controlled deployments, actions may be simplified, but backup, verification, and documentation must still be retained.
Related reading: