# Deployment Repos

Core repositories for TiDB Cloud deployment definitions.

## Overview

| Repo | Type | Description | Local Path |
|------|------|-------------|------------|
| aws-shared-cd | Pulumi | EKS/ACK Free Tier deployment | ~/coding/aws-shared-cd |
| app-delivery | Shell | TiDB Cloud application service delivery | ~/coding/app-delivery |
| auto-deploy | Shell | Auto deployment | ~/coding/auto-deploy |
| infra-cd | Pulumi | Infra API + Multi-Account management | ~/coding/infra-cd |
| oneconfig | Config | Configuration definition repository | ~/coding/oneconfig |

---

## aws-shared-cd

**Purpose:** Dev/Staging EKS/ACK cluster deployment

**Tech Stack:** Pulumi (TypeScript)

**Directory Structure:**
```
pool/
├── eks-freetier/      # EKS Free Tier deployment
│   ├── Pulumi.*.yaml  # Stack configs (dev/staging/prod)
│   ├── serverless.ts  # Serverless components
│   ├── o11y.ts        # Observability components
│   └── ...
├── ack-freetier/      # ACK Free Tier deployment
└── manifests/         # K8s manifests
```

**Branch Strategy:**
- `main` → dev environment
- `release-*` → staging environment

**Workflow:** PR merge triggers GitHub Actions auto-deployment

**Related Repos:**
- `aws-shared-cd-prod` - Production version lock (not a deployment definition)
- `aws-shared-provider` - Infrastructure provider

---

## app-delivery

**Purpose:** TiDB Cloud application service delivery

**Tech Stack:** Shell

**Status:** Core deployment definition (pending detailed investigation)

---

## auto-deploy

**Purpose:** Auto deployment

**Tech Stack:** Shell

**Status:** Core deployment definition (pending detailed investigation)

---

## infra-cd

**Purpose:** Infrastructure deployment + multi-account management

**Tech Stack:** Pulumi (TypeScript)

**Directory Structure:**
```
projects/
├── apiserver/         # Infra API Server deployment
├── aws-accounts/      # AWS multi-account management
├── gcp-projects/      # GCP project management
└── infra-api/         # Infra API deployment

*.ts                   # Pulumi programs (6500+ lines)
```

**Managed Components:**
- Infra API Server
- Infra etcd
- Crossplane provider-aws
- Crossplane provider-gcp
- AWS multi-account management

**Activity:** Low (1 commit per year, but manages core infrastructure)

**Branch Strategy:** Only `main` branch, merge automatically applies to dev/staging

---

## oneconfig

**Purpose:** Centralized configuration file management for all services

**Tech Stack:** Git + Jenkins

**Directory Structure:**
```
account/               # account service config
billing/               # billing service config
dataflow/              # dataflow service config
dataservices/          # dataservices service config
ecosystem/             # ecosystem service config
eventbus/              # eventbus service config
...
```

**Branch to Environment Mapping:**
- `dev` → dev env, nightly namespace
- `staging` → staging env, staging namespace
- `prod` → prod env, prod namespace
- `personal/${name}` → dev env, `${name}` namespace

**Workflow:** Modify config → PR review → Jenkins applies to corresponding environment

**SDK:** Go viper sdk (`github.com/tidbcloud/config-service/oneconfig`)

**Runtime Service:** `config-center` (config center API service)

---

## Related Files

- `deployment-repos.json` - JSON data source for this file
- `deployment-repos-non-tidbcloud.json` - Non-TiDB Cloud deployment repos
- `repos-private.json` - All private repositories
- `repos-public.json` - All public repositories
- `repos-forks.json` - All forked repositories
