Pastebin
Retrouvez, créez et partagez vos snippets en temps réel.
Rechercher un Pastebin
Aucun paste trouvé.
Créer un paste
Pastebin
Blog
rrrrrrrrrrrrr
# SGAIA Continuous Deployment – Developer Guide ## 1. Purpose of This Repository This repository contains the **deployment automation framework** for the SGAIA platform (FrontOffice, BackOffice, and Identity services). Deployments are executed using a **single interactive convenience script** that orchestrates Ansible playbooks to: * Deploy or rollback applications * Target Production or Pre-Production environments * Manage FrontOffice and BackOffice components independently or together All operational instructions and safety confirmations are **embedded in the script itself**. Developers are only expected to: * Place build artifacts in the correct directories * Execute the script from WSL * Follow the interactive prompts --- ## 2. Deployment Execution Model (Important) ### 2.1 Why WSL Is Required Although this repository is located on **Windows** (`D:\SGAIA-CD`), all deployments must be executed from **WSL (Linux shell)** because: * Ansible runs natively on Linux * SSH/WinRM tooling is handled from WSL * The deployment scripts are written for Bash ### 2.2 Windows ↔ WSL Path Mapping | Windows Path | WSL Path | | ------------- | ----------------- | | `D:\SGAIA-CD` | `/mnt/d/SGAIA-CD` | --- ## 3. How to Run a Deployment ### 3.1 Open WSL in the Correct Directory 1. Open **File Explorer** 2. Navigate to: ```text D:\SGAIA-CD ``` 3. Click on the **address bar** 4. Type: ```text wsl ``` 5. Press **Enter** A WSL terminal will open **already positioned in**: ```bash /mnt/d/SGAIA-CD ``` --- ### 3.2 Execute the Deployment Script Run: ```bash ./deploy-sgaia.sh ``` If execution permissions are missing: ```bash chmod +x deploy-sgaia.sh ./deploy-sgaia.sh ``` --- ### 3.3 Interactive Menu Behavior The script will: 1. Prompt you to select the target **environment** (Production or Pre-Production) 2. Display an **interactive menu** allowing you to: * Deploy or rollback individual components * Deploy or rollback FrontOffice or BackOffice stacks * Deploy or rollback all systems * Check IIS status, backups, logs, and connectivity ⚠️ All **consignes**, confirmations, and warnings are displayed directly by the script. Always read prompts carefully before confirming actions. --- ## 4. Repository Structure ```text SGAIA-CD/ │ ├── deploy-sgaia.sh │ ├── inventories/ ├── playbooks/ ├── packages/ └── configs/ ``` Each directory has a clearly defined responsibility, detailed below. --- ## 5. Directory Breakdown ### 5.1 `inventories/` ```text inventories/ ├── production/ │ └── hosts.yml └── preproduction/ └── hosts.yml ``` **Purpose** * Defines target servers and host groups (fo_web, fo_app, bo_web, bo_app, etc.) * Separates Production and Pre-Production environments * Automatically selected by the script based on user input ⚠️ Developers should **not modify inventories** unless explicitly instructed. --- ### 5.2 `playbooks/` ```text playbooks/ ├── deploy-fo-frontend.yml ├── deploy-fo-backend.yml ├── deploy-bo-frontend.yml ├── deploy-bo-backend.yml ├── deploy-bo-identity.yml │ ├── rollback-fo-frontend.yml ├── rollback-fo-backend.yml ├── rollback-bo-frontend.yml ├── rollback-bo-backend.yml ├── rollback-bo-identity.yml ``` **Purpose** * Contain the actual deployment and rollback logic * Each menu action maps to one playbook * Rollbacks restore the last known safe backup on target servers ⚠️ Playbooks should not be executed manually. Always use the convenience script. --- ### 5.3 `packages/` (Most Important for Developers) ```text packages/ ├── FO-frontend/ ├── FO-backend/ ├── BO-frontend/ ├── BO-backend/ └── BO-identity/ ``` **Purpose** * Holds the **build artifacts** to be deployed * Files here are copied to IIS targets during deployment * Script validates presence and non-emptiness before proceeding **Developer Rules** * Place the **latest build** in the appropriate directory * Directories must not be empty * Backend packages must include required runtime files (DLLs, `web.config`, etc.) * Frontend packages must contain compiled static assets If a directory is missing or empty, the deployment will be aborted. --- ### 5.4 `configs/` ```text configs/ ├── fo-frontend/ ├── fo-backend/ ├── bo-frontend/ ├── bo-backend/ └── bo-identity/ ``` **Purpose** * Stores **production-ready configuration overrides** * Overrides packaged defaults during deployment * Ensures environment-specific values are applied **Typical contents** * `web.config` * `appsettings.Production.json` * IIS-specific configuration files ⚠️ Configuration files in `configs/` take precedence over those packaged in `packages/`. --- ## 6. Deployment Philosophy * Single entry point for all deployments * No direct server access required * Rollbacks always available * Explicit confirmations for all critical actions * Clear separation between build artifacts, configuration, and deployment logic --- ## 7. Typical Developer Workflow 1. Build the application (CI or locally) 2. Copy build artifacts into `packages/<component>` 3. Update configuration in `configs/<component>` if required 4. Open WSL from `D:\SGAIA-CD` 5. Execute: ```bash ./deploy-sgaia.sh ``` 6. Follow the interactive instructions --- ## 8. Final Notes * Do not run deployments from Windows PowerShell * Do not execute Ansible playbooks directly * Always verify the selected environment * Use rollback immediately if validation fails This repository is designed to enable safe, repeatable, and controlled deployments with minimal operational risk.
Créé il y a 4 semaines.