Files
Maison/arti-api/auth-service/PROJECT-STRUCTURE.md
2026-02-10 12:12:11 +01:00

115 lines
4.7 KiB
Markdown

# 📁 Project Structure - Auth Service
```
auth-service/
├── 📄 .drone.jsonnet # Main pipeline entry point (imports from pipeline/)
├── 📄 app.py # Main application code
├── 📄 Dockerfile # Container build definition
├── 📄 requirements.txt # Python dependencies
├── 📄 README.md # Application documentation
└── 📁 pipeline/ # 🎯 CI/CD Pipeline Configuration
├── 🔧 Jsonnet Configuration
│ ├── common.libsonnet # Shared pipeline components
│ ├── build-steps.libsonnet # Build-specific logic
│ └── .drone.jsonnet # Original pipeline config (moved here)
├── 🚀 Management Scripts
│ ├── manage-external-buildah.sh # Buildah service management
│ ├── update-buildah-pod.sh # Auto-update pod references
│ ├── deploy-external-buildah.sh # Complete system deployment
│ └── convert-to-jsonnet.sh # YAML to Jsonnet migration
├── ⚙️ Kubernetes Resources
│ ├── buildah-external-deployment.yaml # External Buildah service
│ ├── buildah-rbac.yaml # Buildah RBAC permissions
│ ├── drone-build-rbac.yaml # Drone build permissions
│ ├── default-sa-binding.yaml # Service account bindings
│ ├── drone-configmap-updated.yaml # Drone server config
│ └── kubernetes-auth.yaml # Auth service deployment
├── 📋 Alternative Configs
│ ├── .drone.yml.backup # Original YAML backup
│ ├── .drone.yml.external-buildah # Basic external build
│ ├── .drone.yml.external-buildah-advanced # Advanced build
│ ├── .drone.yml.external-buildah-production # Production build
│ ├── .drone.yml.buildah-privileged # Privileged container attempts
│ ├── .drone.yml.img-alternative # img builder variant
│ ├── .drone.yml.nerdctl-alternative # nerdctl builder variant
│ └── values-example.yaml # Kubernetes deployment values
└── 📚 Documentation
├── PIPELINE-README.md # Pipeline folder overview
├── EXTERNAL-BUILDAH-SYSTEM.md # External build system guide
├── JSONNET-GUIDE.md # Jsonnet usage documentation
├── DRONE-SETUP.md # Drone setup instructions
├── GIT-WEBHOOK-CONFIG.md # Webhook configuration
└── MULTI-DOMAIN-GUIDE.md # Multi-domain setup
```
## 🎯 **Key Benefits of This Structure**
### **🧩 Organized Layout**
- **Clear separation** of application code vs pipeline configuration
- **Dedicated folder** for all CI/CD related files
- **Easy navigation** and maintenance
### **🔄 Modular Pipeline**
- **Jsonnet-based** configuration with imports
- **Reusable components** in libsonnet files
- **Alternative configurations** for different scenarios
### **🛠️ Complete Toolset**
- **Management scripts** for operational tasks
- **Kubernetes resources** for deployment
- **Documentation** for guidance and troubleshooting
### **📝 Maintainability**
- **Single location** for all pipeline changes
- **Version controlled** configurations and scripts
- **Clear dependencies** and relationships
## 🚀 **Usage Workflows**
### **Development Workflow**
```bash
# 1. Edit pipeline configuration
vim pipeline/common.libsonnet pipeline/build-steps.libsonnet
# 2. Test configuration locally
jsonnet .drone.jsonnet
# 3. Commit and push
git add . && git commit -m "Update pipeline" && git push
```
### **Operations Workflow**
```bash
# Check system status
pipeline/manage-external-buildah.sh status
# Deploy/redeploy system
pipeline/deploy-external-buildah.sh
# Update after pod restarts
pipeline/update-buildah-pod.sh
```
### **Migration Workflow**
```bash
# Convert YAML to Jsonnet (if needed)
pipeline/convert-to-jsonnet.sh
# Use alternative configurations
cp pipeline/.drone.yml.external-buildah-production .drone.yml
```
## 🔗 **Integration Points**
- **Root `.drone.jsonnet`** imports from `pipeline/` folder
- **Scripts reference** local files within pipeline folder
- **Documentation cross-references** between files
- **Kubernetes resources** work together as complete system
This structure provides a **clean, maintainable, and scalable** approach to managing your CI/CD pipeline while keeping application code separate from infrastructure concerns.