Deployment means sending written code from the development environment to a place where real users can reach it. As long as an application runs only on the programmer's computer, it hasn't been deployed yet.
Common methods#
- Manual: uploading files with FTP or the hosting file manager. Simple, but risky and easy to forget things.
- With Git: the server pulls the code from the repository (git pull), so manual upload is no longer needed.
- Automated with CI/CD: with every approved change, the pipeline performs the steps by itself.
- With containers: a new image is built and replaces the old container.
Example#
You've written a WordPress plugin. If you replace the files on the host by hand every time, there is a high chance of missing a file or getting a path wrong. With a deployment tool, one command or click puts all the right files in the right place and, if needed, restores the previous version.
Important notes#
- Test on a staging environment before release.
- Take a backup of the database and files.
- Choose a low-traffic hour or do a gradual release.
- Have a quick rollback ready.
A common mistake#
Editing files directly on the production server. Such a change isn't tracked, leaves no history, and is hard to undo if it breaks. Make every change in development first and then release it.