feat: complete initial project structure for API and Monitoring Dashboards
هذا الالتزام موجود في:
17
ci/README.md
Normal file
17
ci/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Environments: Staging vs Production
|
||||
|
||||
In our deployment pipeline, we utilize two main environments: **Staging** and **Production**. Understanding the differences between them is crucial for safe software delivery.
|
||||
|
||||
## 1. Staging Environment (`staging`)
|
||||
- **Purpose:** A pre-production area for QA testing, integration testing, and final review by stakeholders before a release goes live.
|
||||
- **Data:** Uses dummy, sanitized, or replicated data. NEVER connects to the live production database.
|
||||
- **Access:** Restricted to internal team members, developers, and QA testers. Often protected by VPN, IP whitelisting, or Basic Auth.
|
||||
- **Scale:** Typically scaled down (fewer containers, smaller database instances) to save costs, as it doesn't need to handle user traffic.
|
||||
- **Deployment:** Automatic upon merging code to the `main` branch.
|
||||
|
||||
## 2. Production Environment (`production`)
|
||||
- **Purpose:** The live environment that real users interact with.
|
||||
- **Data:** Contains live, sensitive, real user data. Strict access controls and backups are enforced.
|
||||
- **Access:** Publicly accessible (for web apps/APIs). Infrastructure access is strictly limited to authorized SREs/DevOps personnel.
|
||||
- **Scale:** Scaled up to handle expected user load, with Auto-Scaling policies enabled to handle traffic spikes.
|
||||
- **Deployment:** Requires a **Manual Approval** step in the CI/CD pipeline (e.g., in GitHub Actions) to ensure that the code deployed to staging has been properly vetted and approved for live release.
|
||||
44
ci/ghaymah_cli.md
Normal file
44
ci/ghaymah_cli.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Integrating with the ghaymah CLI
|
||||
|
||||
To manage and deploy applications to ghaymah.systems from your local machine or CI/CD pipeline, you need to use the `ghaymah` CLI.
|
||||
|
||||
## 1. Installation
|
||||
Depending on your OS, install the CLI (example for macOS/Linux):
|
||||
```bash
|
||||
curl -sL https://cli.ghaymah.systems/install.sh | bash
|
||||
```
|
||||
|
||||
## 2. Authentication
|
||||
Log in to your ghaymah account:
|
||||
```bash
|
||||
ghaymah login
|
||||
```
|
||||
This will open a browser window to authenticate. If you are in a CI/CD environment (headless), use a token:
|
||||
```bash
|
||||
ghaymah login --token $GHAYMAH_TOKEN
|
||||
```
|
||||
|
||||
## 3. Pushing Images to ghaymah Container Registry
|
||||
Authenticate Docker with the ghaymah registry:
|
||||
```bash
|
||||
docker login registry.ghaymah.systems -u $GHAYMAH_USERNAME -p $GHAYMAH_TOKEN
|
||||
```
|
||||
Build and push your image:
|
||||
```bash
|
||||
docker build -t registry.ghaymah.systems/my-org/myapp-api:v1 .
|
||||
docker push registry.ghaymah.systems/my-org/myapp-api:v1
|
||||
```
|
||||
|
||||
## 4. Deploying the Application
|
||||
Once the image is in the registry, deploy it using the CLI:
|
||||
```bash
|
||||
ghaymah deploy \
|
||||
--name myapp-api \
|
||||
--image registry.ghaymah.systems/my-org/myapp-api:v1 \
|
||||
--port 8080 \
|
||||
--env production
|
||||
```
|
||||
You can also monitor logs in real-time:
|
||||
```bash
|
||||
ghaymah logs myapp-api --follow
|
||||
```
|
||||
المرجع في مشكلة جديدة
حظر مستخدم