nanyang-system-developers

Deployment

Overview

Deployment is a crucial step in the software development lifecycle that involves making an application available for use. Unlike simply running a program on a specified host, deployment ensures that the application is correctly configured, scalable, and accessible to users.

Why Deployment is Necessary

Running a program on a local machine or a specified host might work for development and testing, but it is not sufficient for production environments. Deployment addresses several key aspects:

  1. Configuration Management: Deployment scripts handle the configuration of the environment, ensuring that all dependencies, environment variables, and settings are correctly applied.
  2. Scalability: Deployment processes often include steps to distribute the application across multiple servers or containers, allowing it to handle increased load.
  3. Reliability: Automated deployment scripts reduce the risk of human error, ensuring that the application is consistently deployed in the same manner.
  4. Continuous Integration/Continuous Deployment (CI/CD): Deployment is a critical part of CI/CD pipelines, enabling automated testing and release of new features.

Deployment Script vs. Run Script

A run script typically starts the application on a local machine or a single server. It might look something like this:

# run.sh
python app.py

In contrast, a deployment script involves multiple steps to prepare the application for production. It might include building the application, running tests, configuring servers, and more. An example deployment script might look like this:

# deploy.sh
git pull origin main
docker build -t myapp:latest .
docker-compose up -d

Further Reading