Testing and Deployment Workflow: Tools and Commands Ready to Reuse

A deployment script doesn't need to be complicated. Fix those five actions and you can eliminate the biggest risk—missing a step.

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:

  1. Homepage is accessible.
  2. A detail page is accessible.
  3. Forms can be submitted.
  4. Admin panel login works.
  5. 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: