# RedTag-Prod Services CI/CD Migration Summary

**Date**: 2026-03-24
**Status**: ✅ CONFIGS GENERATED - Ready for Review
**Total Services**: 35
**Total Deployments**: 105 (35 × 3 environments)
**Total Files**: ~1,545

---

## Overview

Migrated 35 redtag-prod application services from Jenkins CI/CD to CircleCI pipelines in `tbi-devops-environments/` across 3 environments: dev, uat, and redtag-prod.

---

## Repo → Service Mapping

### Multi-Service Repos (4 repos → 21 services)

| Repo | Services | Namespace(s) | Tech |
|------|----------|-------------|------|
| `tbi-rlv-booking-path` | tbi-rlv-booking-path, tbi-rlv-sales-agent-booking-path, tbi-rlv-market-booking-path, tbi-rlv-affiliate-booking-path, tbi-itravel-booking-path, tbi-sunquest-booking-path, tbi-his-traveljapan-booking-path, tbi-flights-booking-path | redtag, itravel, sunquest, his, flightsca | PHP 8.0 + Webpack |
| `tbi-rlv-dynamic-path` | tbi-rlv-dynamic, tbi-itravel-dynamic-path, tbi-sunquest-dynamic-path, tbi-his-traveljapan-dynamic-path | redtag, itravel, sunquest, his | PHP 8.0 + Webpack |
| `tbi-admin-redlabel-ca` | tbi-admin-redlabel-ca, tbi-admin-redlabel-cron, tbi-admin-redlabel-cron-2, tbi-admin-redlabel-cron-3 | itravel, cronjobs | PHP 7.0 |
| `tbi-itravel2000-com` | tbi-itravel2000-com, tbi-itravel2000-cron, tbi-itravel2000-cron-2, tbi-itravel2000-cron-3, tbi-itravel2000-cron-4 | itravel, cronjobs | PHP 7.0 |

### Single-Service Repos (14 repos → 14 services)

| Service | Namespace | Tech |
|---------|-----------|------|
| tbi-redtag-cms | redtag | PHP 8.0 |
| tbi-rlv-attraction-frontend | redtag | Node.js 18 |
| tbi-rlv-frontend-service | redtag | Node.js 17 |
| tbi-rlv-giftcard-service | redtag | Node.js 17 |
| tbi-rlv-hotel-content-service | redtag | PHP 8.0 |
| tbi-rlv-insurance-service | redtag | PHP 8.0 |
| tbi-rlv-attraction-bff-service | redtag | Node.js 17 |
| tbi-rlv-petro-points-service | redtag | Node.js 17 |
| tbi-rlv-vacations-bff-service | redtag | Node.js 20 |
| tbi-sunquest-ca | sunquest | PHP 7.3 |
| tbi-his-traveljapan-com | his | PHP 7.3 |
| tbi-flights-ca | flightsca | PHP 7.3 |
| tbi-travelexperts-ca | travelexperts | PHP 8.0 |
| tbi-travelexperts-redtag-ca | travelexperts | PHP 8.0 |

**Total: 18 repos → 35 services**

---

## Environment Configuration

| Setting | Dev | UAT | redtag-prod |
|---------|-----|-----|-------------|
| DEPLOY_ENV | `dev` | `uat` | `redtag-prod` |
| CLUSTER_NAME | `dev` | `uat` | `redtag-prod` |
| HELM_S3_BUCKET | `tbi-charts` | `tbi-charts` | `tbi-charts-prod` |
| envFolder | `dev` | `uat` | `redtag-prod` |
| Context | `devops-mgt` | `devops-mgt` | `devops-mgt-prod` |
| Runner | `tbi-local-runner/loadtest` | `tbi-local-runner/loadtest` | `tbi-local-runner/prod-win` |
| Branch | `develop` | `uat` | `master` |
| Approvals | None (auto-deploy) | None (auto-deploy) | 2-stage (build+deploy) |
| Namespace | `redtag` (all services) | `redtag` (all services) | per-service |
| SNS Notifications | No | No | Yes (4 per deploy) |

---

## Pipeline Workflows

### Dev / UAT (auto-deploy)
```
lint-and-test → build-and-push-images → deploy-to-kubernetes
```

### redtag-prod (2-stage approval)
```
lint-and-test → notify-await-build-approval → approve-build → build-and-push-images → notify-await-deploy-approval → approve-deploy → deploy-to-kubernetes
```

---

## Files Per Service

```
redtag-prod/{service}/
├── .circleci/config.yml
├── docker/Dockerfile
├── scripts/
│   ├── deploy-services.sh
│   └── setup-kubectl.sh
├── charts/{service}/
│   ├── Chart.yaml
│   ├── values.yaml
│   └── templates/
│       ├── deployment.yaml
│       ├── service.yaml
│       ├── ingress.yaml
│       ├── hpa.yaml
│       ├── pdb.yaml
│       └── secrets.yaml
├── .github/workflows/manage-secrets.yml
└── README.md
```

---

## Shared Image Pattern

Multi-service repos build one Docker image and deploy it to multiple services/namespaces. Each service has its own:
- Helm chart (different namespace, values, ingress)
- CircleCI config (references the shared ECR image)
- Deploy script (deploys to its specific namespace)

Example: `tbi-rlv-booking-path` repo builds one image → deployed as 8 different services across 5 namespaces.

---

## Pre-Existing Services

5 redtag-mobile services already existed in `redtag-prod/` before this migration:
- tbi-redtag-mobile-hotel-service
- tbi-redtag-mobile-ms-activities
- tbi-redtag-mobile-ms-bookings
- tbi-redtag-mobile-ms-cars
- tbi-redtag-mobile-ms-flights

These were not modified by this generation.

---

## Generation Scripts

All configs were generated using reusable scripts with templates from `scripts/redtag-prod-templates/`.

- **redtag-prod**: `bash scripts/generate-redtag-prod.sh`
- **dev + uat**: `bash scripts/generate-redtag-dev-uat.sh`

---

## Next Steps

- [ ] Review generated configs
- [ ] Verify Dockerfiles match current app repo builds
- [ ] Configure CircleCI projects for each service
- [ ] Set up CircleCI contexts (devops-mgt-prod)
- [ ] Test with one service end-to-end
- [ ] Update Jenkins blacklist in `tbi-environments/Jenkinsfile`
- [ ] Roll out remaining services
