{"id":23477653,"url":"https://github.com/devpaulpops/geturlcloudrun","last_synced_at":"2025-04-13T14:16:39.979Z","repository":{"id":268281918,"uuid":"902403642","full_name":"DevPaulPOps/GetUrlCloudRun","owner":"DevPaulPOps","description":"Microservice Go pour récupérer les URLs des services Cloud Run sur GCP avec déploiement Terraform automatisé 🚀","archived":false,"fork":false,"pushed_at":"2024-12-15T21:55:56.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T14:16:24.588Z","etag":null,"topics":["api","ci-cd","cloud-run","devops","docker","golang","google-cloud-platform","infrastructure-as-code","microservice","terraform"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevPaulPOps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-12T13:56:33.000Z","updated_at":"2024-12-15T21:56:00.000Z","dependencies_parsed_at":"2024-12-15T19:33:12.406Z","dependency_job_id":"bd21c1a2-9b29-4f4a-a21a-8e5f4ec5a8d8","html_url":"https://github.com/DevPaulPOps/GetUrlCloudRun","commit_stats":null,"previous_names":["devpaulpops/geturlcloudrun"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevPaulPOps%2FGetUrlCloudRun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevPaulPOps%2FGetUrlCloudRun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevPaulPOps%2FGetUrlCloudRun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevPaulPOps%2FGetUrlCloudRun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevPaulPOps","download_url":"https://codeload.github.com/DevPaulPOps/GetUrlCloudRun/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724624,"owners_count":21151561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","ci-cd","cloud-run","devops","docker","golang","google-cloud-platform","infrastructure-as-code","microservice","terraform"],"created_at":"2024-12-24T18:28:00.062Z","updated_at":"2025-04-13T14:16:39.942Z","avatar_url":"https://github.com/DevPaulPOps.png","language":"Go","readme":"# 🚀 GetUrlCloudRun\n\n[![Go](https://img.shields.io/badge/Go-1.22.2-00ADD8.svg)](https://golang.org)\n[![Gin](https://img.shields.io/badge/Gin-1.9.1-00ADD8.svg)](https://gin-gonic.com/)\n[![Cloud Run](https://img.shields.io/badge/Cloud%20Run-1.3.6-4285F4.svg)](https://cloud.google.com/run)\n[![Docker](https://img.shields.io/badge/Docker-Ready-2496ED.svg)](https://www.docker.com/)\n[![Terraform](https://img.shields.io/badge/Terraform-Ready-7B42BC.svg)](https://www.terraform.io)\n\nMicroservice Go permettant de récupérer les URLs des services Cloud Run déployés sur Google Cloud Platform via une API REST.\n\n## 📑 Table des Matières\n\n- [Objectifs](#-objectifs)\n- [Architecture](#-architecture)\n- [Stack Technique](#-stack-technique)\n- [Installation](#-installation)\n- [Configuration](#-configuration)\n- [API Reference](#-api-reference)\n- [Infrastructure](#-infrastructure)\n- [Contribution](#-contribution)\n- [Authentification](#-authentification)\n\n## 🎯 Objectifs\n\n1. Authentification GCP sécurisée\n2. Listing des services Cloud Run\n3. Récupération des métadonnées de service\n4. Exposition des URLs via API REST\n5. Déploiement automatisé sur GCP\n\n## 🏗️ Architecture\n\n```sh\n.\n├── api/           # Handlers API REST et routes Gin\n├── config/        # Configuration et gestion des paramètres\n├── gcp/           # Client et services Google Cloud\n├── model/         # Modèles de données\n├── terraform/     # Infrastructure as Code\n└── util/          # Utilitaires et gestion d'erreurs\n```\n\n## 💻 Stack Technique\n\n### Core\n\n- Go 1.22.2\n- Gin Web Framework 1.9.1\n- Cloud Run API 1.3.6\n\n### Google Cloud Platform\n\n- Cloud SDK v0.112.1\n- Cloud Run\n- Container Registry\n- Secret Manager\n\n### Dépendances Principales\n\n- gin-gonic/gin v1.9.1\n- gin-contrib/cors v1.7.1\n- google.golang.org/api v0.169.0\n- protobuf v1.33.0\n\n### Infrastructure\n\n- Terraform\n- Docker\n\n## 🚀 Installation\n\n### Prérequis\n\n- Go \u003e= 1.22.2\n- Google Cloud SDK\n- Terraform \u003e= 1.0\n- Docker \u003e= 20.10\n- Compte GCP avec Cloud Run activé\n\n### Installation Locale\n\n```bash\n# Clone du repository\ngit clone git@github.com:DevPaulPOps/GetUrlCloudRun.git\ncd GetUrlCloudRun\n\n# Installation des dépendances\ngo mod download\ngo mod tidy\n\n# Vérification de la version Go\ngo version  # Doit afficher go1.22.2 ou supérieur\n\n# Lancement du service\ngo run main.go\n```\n\n### Installation Docker\n\n```bash\n# Build de l'image\ndocker build -t geturlcloudrun:latest .\n\n# Lancement avec configuration\ndocker run -p 3000:3000 \\\n  -v $(pwd)/config.json:/go/src/app/config.json \\\n  geturlcloudrun:latest\n```\n\n## ⚙️ Configuration\n\n### Structure du fichier config.json\n\n```json\n{\n\t\"AccountJSON\": \"/path/to/service-account.json\",\n\t\"Parent\": \"projects/YOUR_PROJECT/locations/REGION\"\n}\n```\n\n### Variables d'Environnement\n\n```env\nGCP_PROJECT_ID=your-project-id\nGCP_REGION=us-central1\n```\n\n## 📡 API Reference\n\n### Lister tous les services\n\n```http\nGET /service\n```\n\n#### Réponse\n\n```json\n[\n\t{\n\t\t\"Name\": \"service-name\",\n\t\t\"Url\": \"https://service-xxx-uc.a.run.app\"\n\t}\n]\n```\n\n### Récupérer un service spécifique\n\n```http\nGET /service/:name\n```\n\n#### Réponse\n\n```json\n{\n\t\"url\": \"https://service-xxx-uc.a.run.app\"\n}\n```\n\n## 🏗️ Infrastructure\n\n### Terraform\n\n```bash\ncd terraform\nterraform init\nterraform plan\nterraform apply\n```\n\n### Pipeline CI/CD (Cloud Build)\n\n1. Build de l'image Docker\n2. Push vers Artifact Registry\n3. Déploiement Terraform\n4. Configuration Cloud Run\n\nConfiguration détaillée dans `cloudbuild.yaml`\n\n## 🔐 Authentification GCP\n\n1. Créer un compte de service GCP\n\n   - Accéder à la console GCP\n   - IAM \u0026 Admin \u003e Comptes de service\n   - Créer un nouveau compte\n\n2. Attribuer les rôles nécessaires\n\n   - `roles/run.viewer` (minimum requis)\n   - `roles/storage.objectViewer` (pour Artifact Registry)\n\n3. Générer et télécharger les credentials\n   - Format JSON\n   - Configurer le chemin dans `config.json`\n\n## 📝 Bonnes Pratiques\n\n- Utilisation de contexts pour la gestion des timeouts\n- Gestion d'erreurs centralisée\n- Configuration externalisée\n- Architecture modulaire\n- Documentation complète des APIs\n\n## 🤝 Contribution\n\n1. Fork le projet\n2. Créer une branche (`git checkout -b feature/amazing-feature`)\n3. Commit (`git commit -m 'feat: Add amazing feature'`)\n4. Push (`git push origin feature/amazing-feature`)\n5. Ouvrir une Pull Request\n\n---\n\n_Développé avec ❤️ pour simplifier la gestion des services Cloud Run_\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevpaulpops%2Fgeturlcloudrun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevpaulpops%2Fgeturlcloudrun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevpaulpops%2Fgeturlcloudrun/lists"}