# TBI DevOps Environments Repository

Centralized repository for CI/CD configurations, documentation, and scripts for TBI RedTag and RLV microservices.

## Repository Structure

```
tbi-devops-environments/
├── docs/                                    # Documentation
│   ├── SECRETS-PIPELINE-SETUP.md           # Complete setup guide
│   ├── MIGRATION-CHECKLIST.md              # Migration checklist
│   └── QUICK-REFERENCE.md                  # Command reference
│
├── scripts/                                 # Automation scripts
│   └── migrate-service.sh                  # Service migration helper
│
├── dev/                                     # Development environment
│   ├── tbi-redtag-mobile-hotel-service/
│   │   ├── .github/workflows/              # GitHub Actions workflows
│   │   │   └── manage-secrets.yml
│   │   ├── .circleci/                      # CircleCI configuration
│   │   │   └── config.yml
│   │   ├── docker/                         # Docker configuration
│   │   │   └── Dockerfile
│   │   ├── scripts/                        # Deployment scripts
│   │   │   ├── setup-kubectl.sh
│   │   │   └── deploy-services.sh
│   │   └── charts/                         # Helm charts
│   │       └── tbi-redtag-mobile-hotel-service/
│   ├── tbi-redtag-mobile-ms-flights/
│   ├── tbi-redtag-mobile-ms-cars/
│   ├── tbi-redtag-mobile-ms-activities/
│   ├── tbi-redtag-mobile-ms-bookings/
│   └── tbi-rlv-profile-backend-service/
│
├── qa/                                      # QA environment
│   └── (same structure as dev)
│
├── uat/                                     # UAT environment
│   └── (same structure as dev)
│
└── redtag-prod/                             # Production environment
    └── (same structure as dev)
```

## Purpose

This repository serves as the single source of truth for:

1. **CI/CD Configurations**: GitHub Actions workflows, CircleCI configs, and build scripts
2. **Documentation**: Setup guides, migration checklists, and reference documentation
3. **Automation Scripts**: Helper scripts for service migrations and common operations
4. **Environment-Specific Configs**: Per-environment configurations for each service

## Quick Start

### 📚 Documentation

- **New to secrets pipeline?** → [`docs/SECRETS-PIPELINE-SETUP.md`](docs/SECRETS-PIPELINE-SETUP.md)
- **Migrating a service?** → [`docs/MIGRATION-CHECKLIST.md`](docs/MIGRATION-CHECKLIST.md)
- **Need quick commands?** → [`docs/QUICK-REFERENCE.md`](docs/QUICK-REFERENCE.md)

### 🚀 Migrate a Service

```bash
./scripts/migrate-service.sh flights
```

## Services

### RedTag Mobile Services
| Service | Dev | QA | UAT | Prod |
|---------|-----|----|----|------|
| tbi-redtag-mobile-hotel-service | ✅ | ✅ | ✅ | ✅ |
| tbi-redtag-mobile-ms-flights | ✅ | ✅ | ✅ | ⏳ |
| tbi-redtag-mobile-ms-cars | ✅ | ✅ | ✅ | ⏳ |
| tbi-redtag-mobile-ms-activities | ✅ | ✅ | ✅ | ⏳ |
| tbi-redtag-mobile-ms-bookings | ✅ | ✅ | ✅ | ⏳ |

### ACC Services

**Migration Status**: ✅ COMPLETE - Pipeline Migration (Existing CI/CD → CircleCI)
**Progress**: 20/20 services with code completed (100%)
**Type**: Services already running, migrated CI/CD pipelines

**Production Status**: ✅ COMPLETE - 2-Stage Approval Workflow
**Prod Configs**: 20/20 services with approval gates and SNS notifications (100%)

📋 **Documentation**:
- [📊 Complete Migration Summary](docs/COMPLETE-MIGRATION-SUMMARY.md) - **COMPREHENSIVE OVERVIEW**
- [🔒 Production Approval Workflow](docs/PROD-APPROVAL-WORKFLOW-COMPLETE.md) - **PROD DEPLOYMENT GUIDE**
- [🎯 Final Batch Summary](docs/FINAL-BATCH-CRON-SERVICES.md) - Last 2 services
- [📝 Migration Tracker](docs/MIGRATION-COMMIT-TRACKER.md) - All batches tracked
- [🚀 UAT/Prod Plan](docs/UAT-PROD-DEPLOYMENT-PLAN.md) - Multi-environment strategy

🛠️ **Scripts**:
- [Clone Script](scripts/clone-acc-services.sh) - Clone all ACC repositories
- [Update Prod Configs](scripts/update_prod_configs.py) - Automated prod config updates
- [Convert Parameter Configs](scripts/convert_parameter_to_prod.py) - Convert to prod-only

**Summary**: 20 services × 3 environments (dev, uat, prod) = 60 deployments configured
**Prod Features**: 2-stage approval gates, SNS notifications, clean version tags, prod-only branch filters

| Service | Dev | UAT | Prod | Tech Stack | Prod Approval |
|---------|-----|-----|------|------------|---------------|
| tbi-acc-booking-service | ✅ | ✅ | ✅ | Node.js 20 + NestJS | ✅ 2-stage |
| tbi-acc-quotes-service | ✅ | ✅ | ✅ | Node.js 20 + NestJS | ✅ 2-stage |
| tbi-acc-notification-service | ✅ | ✅ | ✅ | Node.js 20 + NestJS | ✅ 2-stage |
| tbi-acc-mybooking-service | ✅ | ✅ | ✅ | Node.js 20 + NestJS | ✅ 2-stage |
| tbi-acc-ceetiz-connector | ✅ | ✅ | ✅ | Node.js 20 + NestJS | ✅ 2-stage |
| tbi-acc-exotiktours-connector | ✅ | ✅ | ✅ | Node.js 20 + NestJS | ✅ 2-stage |
| tbi-acc-profile-service | ✅ | ✅ | ✅ | Node.js 20 + NestJS | ✅ 2-stage |
| tbi-acc-profile-sync-service | ✅ | ✅ | ✅ | Node.js 20 + NestJS | ✅ 2-stage |
| tbi-acc-hotel-service | ✅ | ✅ | ✅ | PHP 8.0 + Lumen | ✅ 2-stage |
| tbi-acc-package-service | ✅ | ✅ | ✅ | PHP 8.0 + Lumen | ✅ 2-stage |
| tbi-acc-hotel-service-connector | ✅ | ✅ | ✅ | PHP 8.0 + Lumen | ✅ 2-stage |
| tbi-acc-travelbrandsagent | ✅ | ✅ | ✅ | PHP 8.0 + Laravel | ✅ 2-stage |
| tbi-acc-gimmonix-automation | ✅ | ✅ | ✅ | PHP 8.0 + Laravel | ✅ 2-stage |
| tbi-acc-mybooking-frontend | ✅ | ✅ | ✅ | Next.js + Webpack | ✅ 2-stage |
| tbi-acc-mybff | ✅ | ✅ | ✅ | Node.js + Webpack | ✅ 2-stage |
| tbi-acc-sabreapi | ✅ | ✅ | ✅ | Node.js + Webpack | ✅ 2-stage |
| tbi-acc-travelbrands | ✅ | ✅ | ✅ | Webpack | ✅ 2-stage |
| tbi-acc-cron-service | ✅ | ✅ | ✅ | PHP 8.0 + Lumen CronJob | ✅ 2-stage |
| tbi-acc-package-cron | ✅ | ✅ | ✅ | PHP 7.3 + Oracle CronJob | ✅ 2-stage |
| tbi-acc-hotel-mapping-service | ✅ | ✅ | ✅ | Node.js 20 + NestJS | ✅ 2-stage |

**Empty Repos** (no code to migrate): tbi-acc-booking-notification, tbi-acc-corporate-booking, tbi-acc-cronjobs

### RLV Services
| Service | Dev | QA | UAT | Prod |
|---------|-----|----|----|------|
| tbi-rlv-profile-backend-service | ✅ | ✅ | ✅ | ⏳ |
| tbi-rlv-profile-frontend | ✅ | ⏳ | ⏳ | ⏳ |

### RedTag-Prod Services (Jenkins → CircleCI Migration)

**Migration Status**: ✅ CONFIGS GENERATED
**Progress**: 35 services × 3 environments (dev, uat, redtag-prod) = 105 deployments
**Type**: Legacy Jenkins services migrated to CircleCI

📋 **Documentation**: [RedTag-Prod Migration Summary](docs/REDTAG-PROD-MIGRATION-SUMMARY.md)
🛠️ **Scripts**: `scripts/generate-redtag-prod.sh`, `scripts/generate-redtag-dev-uat.sh`

**Multi-Service Repos** (4 repos → 21 services):

| Repo | Services | Prod Namespaces |
|------|----------|-----------------|
| tbi-rlv-booking-path | 8 booking-path variants | redtag, itravel, sunquest, his, flightsca |
| tbi-rlv-dynamic-path | 4 dynamic-path variants | redtag, itravel, sunquest, his |
| tbi-admin-redlabel-ca | admin + 3 crons | itravel, cronjobs |
| tbi-itravel2000-com | itravel2000 + 4 crons | itravel, cronjobs |

**Single-Service Repos** (14 services):

| Service | Prod NS | Tech | Dev | UAT | Prod |
|---------|---------|------|-----|-----|------|
| tbi-redtag-cms | redtag | PHP | ✅ | ✅ | ✅ |
| tbi-rlv-attraction-frontend | redtag | Node.js | ✅ | ✅ | ✅ |
| tbi-rlv-frontend-service | redtag | Node.js | ✅ | ✅ | ✅ |
| tbi-rlv-giftcard-service | redtag | Node.js | ✅ | ✅ | ✅ |
| tbi-rlv-hotel-content-service | redtag | PHP | ✅ | ✅ | ✅ |
| tbi-rlv-insurance-service | redtag | PHP | ✅ | ✅ | ✅ |
| tbi-rlv-attraction-bff-service | redtag | Node.js | ✅ | ✅ | ✅ |
| tbi-rlv-petro-points-service | redtag | Node.js | ✅ | ✅ | ✅ |
| tbi-rlv-vacations-bff-service | redtag | Node.js | ✅ | ✅ | ✅ |
| tbi-sunquest-ca | sunquest | PHP | ✅ | ✅ | ✅ |
| tbi-his-traveljapan-com | his | PHP | ✅ | ✅ | ✅ |
| tbi-flights-ca | flightsca | PHP | ✅ | ✅ | ✅ |
| tbi-travelexperts-ca | travelexperts | PHP | ✅ | ✅ | ✅ |
| tbi-travelexperts-redtag-ca | travelexperts | PHP | ✅ | ✅ | ✅ |

**Environment Config**:

| Setting | Dev | UAT | redtag-prod |
|---------|-----|-----|-------------|
| S3 Bucket | tbi-charts | tbi-charts | tbi-charts-prod |
| Context | devops-mgt | devops-mgt | devops-mgt-prod |
| Runner | loadtest | loadtest | prod-win |
| Branch | develop | uat | master |
| Approvals | None | None | 2-stage (build+deploy) |
| Namespace | redtag | redtag | per-service |

## Related Repositories

- **tbi-environments**: Encrypted secrets storage
- **tbi-devops-common**: Shared DevOps resources (Helm charts, K8s configs)

## Support

- **Documentation**: Check `docs/` directory
- **Issues**: Report at GitHub Issues
- **Contact**: DevOps team

---

## Recent Updates

### 2026-03-24: RedTag-Prod Services Migration
- ✅ Generated CircleCI configs for 35 redtag-prod services
- ✅ 3 environments: dev (develop branch), uat (uat branch), redtag-prod (master branch)
- ✅ 105 total deployments configured
- ✅ 2-stage approval workflow for redtag-prod, auto-deploy for dev/uat
- 📋 See [RedTag-Prod Migration Summary](docs/REDTAG-PROD-MIGRATION-SUMMARY.md)

### 2026-03-11: Production Approval Workflow Complete
- ✅ Added 2-stage approval workflow to all 20 ACC prod configs
- ✅ Implemented SNS notifications (4 per deployment)
- ✅ Updated to devops-mgt-prod context and prod-win runner
- ✅ Restricted to master branch only with clean version tags
- 📋 See [Production Approval Workflow Guide](docs/PROD-APPROVAL-WORKFLOW-COMPLETE.md)

### 2026-02-27: ACC Services Migration Complete
- ✅ Migrated 20 ACC services to CircleCI
- ✅ Configured 60 deployments (dev, uat, prod)
- ✅ Infrastructure-as-code for all environments
- 📋 See [Complete Migration Summary](docs/COMPLETE-MIGRATION-SUMMARY.md)

---

**Last Updated**: 2026-03-24
