Farid Siddiqi 47be003f6d
Some checks failed
Build and Deploy API Server / deploy (push) Has been cancelled
Build and Deploy API Server / build (push) Has been cancelled
Simplify deployment structure and consolidate documentation
- Remove redundant manual setup (setup-vps.sh) - Ansible handles all VPS setup
- Remove config templates directory - Ansible creates .env.production
- Delete verbose DEPLOYMENT_SETUP.md - info consolidated into deployment/README.md
- Rewrite deployment/README.md with clear 3-step workflow
- Simplify deployment/ansible/README.md to quick reference
- Reduce total documentation from 1159 lines to 225 lines

The deployment process is now easier to understand:
1. Run Ansible playbook (one-time setup)
2. Push code to Gitea (auto-builds)
3. SSH and promote to production

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-23 17:47:50 -08:00
..

Ansible Infrastructure Setup

This playbook sets up the complete Gitea + API server infrastructure on a fresh Ubuntu 24.04 VPS.

Quick Start

# 1. Copy and edit inventory
cp hosts.ini.example hosts.ini
# Edit hosts.ini with your VPS details

# 2. Set passwords
export POSTGRES_ADMIN_PASSWORD="your-strong-password"
export API_SERVER_DB_PASSWORD="your-api-db-password"

# 3. Run playbook
ansible-playbook -i hosts.ini site.yml

What This Deploys

Infrastructure

  • Gitea server (Git hosting + Actions)
  • PostgreSQL (separate databases for Gitea and API)
  • 5 Gitea Actions runners (self-hosted)
  • Nginx reverse proxy
  • UFW firewall

API Server Deployment System

  • /opt/api-artifacts/ directory structure
  • Blue-green deployment scripts
  • Systemd service configuration
  • Environment file template

Database Setup

  • gitea database (for Gitea)
  • apiserver database (for your application)
  • pgadmin user (admin access)
  • apiserver user (application access)

Configuration

Edit site.yml to customize:

vars:
  create_separate_apiserver_db: true  # false to share gitea DB
  runner_count: 5                     # Number of runners
  gitea_version: "1.23.3"            # Gitea version

Inventory File

Create hosts.ini:

[git]
your-vps-ip ansible_user=ubuntu ansible_ssh_private_key_file=~/.ssh/key.pem ansible_python_interpreter=/usr/bin/python3

After Ansible Runs

  1. Access Gitea at http://your-vps-ip
  2. Create admin account
  3. Create repository
  4. Push code to trigger builds

See main deployment README for full workflow.