Skip to content

Manual Production Deployments

Richard Salas edited this page Jan 24, 2026 · 2 revisions

Production Deployment Steps

This page outlines the procedure for deploying code to a production environment. Follow these steps to ensure the latest code is merged, built into container images, pushed to ECR, and deployed via Kubernetes.


Table of Contents


Purpose

  • Synchronize Code: Ensure production deployment branch is updated with the latest main branch changes.
  • Build and Publish Images: Generate Docker images for all services and push them to AWS ECR with proper tags.
  • Trigger Rollout: Restart Kubernetes deployments to use the newly built images.

Steps Overview

  1. Clone the repository and check out the deployment branch.
  2. Merge the latest main branch into the deployment branch.
  3. Push the updated branch to the remote repository.
  4. Build and push Docker images for backend, frontend, and provider-middleware to AWS ECR.
  5. Restart Kubernetes deployments to pick up the new images.

Step 1: Checkout Deployment Branch

Clone the repository and switch to the deployment branch:

git clone <repo>
cd <repo>
git checkout <branch_name>

Step 2: Merge Main Branch Code

Reset the deployment branch to match the latest main branch:

git fetch origin
git reset --hard origin/main

Step 3: Push Updates to Remote Branch

Force push the updated branch to the remote repository:

git push origin <branch_name> --force

Step 4: Build and Push Images to ECR

Login to docker ECR:

aws ecr get-login-password | docker login '239442854891.dkr.ecr.us-west-2.amazonaws.com' --username AWS --password-stdin

Use docker buildx to build and push images for all services to AWS ECR:

Backend

docker buildx build --platform linux/amd64 -t 239442854891.dkr.ecr.us-west-2.amazonaws.com/unlockedv2:<tagname> --push -f backend/Dockerfile .

Frontend

docker buildx build --platform linux/amd64 -t 239442854891.dkr.ecr.us-west-2.amazonaws.com/frontend:<tagname> --push frontend/.

Provider Middleware

docker buildx build --platform linux/amd64 -t 239442854891.dkr.ecr.us-west-2.amazonaws.com/provider_middleware:<tagname> --push -f provider-middleware/Dockerfile .

Step 5: Restart Kubernetes Deployments

Restart the Kubernetes deployments to apply the new images:

kubectl rollout restart deployment server
kubectl rollout restart deployment frontend
kubectl rollout restart deployment provider-service

Validation

  • Run kubectl get pods and confirm that all pods are restarted with the new image tags.
  • Verify production endpoints respond correctly with the updated deployment.

Clone this wiki locally