Updating Files
هذا الالتزام موجود في:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"id": "9071e5c5-d122-463c-93d9-86ec7622b39e",
|
"id": "9071e5c5-d122-463c-93d9-86ec7622b39e",
|
||||||
"name": "bin",
|
"name": "Complete-CICD-Workflow-of-WeatheApp",
|
||||||
"projectId": "811b5e36-3b8b-486a-81af-bef0f1980187",
|
"projectId": "811b5e36-3b8b-486a-81af-bef0f1980187",
|
||||||
"ports": [
|
"ports": [
|
||||||
{
|
{
|
||||||
|
|||||||
101
README.md
101
README.md
@@ -1,10 +1,7 @@
|
|||||||
# 🌤️ Weather Forecast App
|
# 🌤️ Complete GitHub Actions CI/CD Weather Forecast App on Ghaymah Cloud
|
||||||
|
|
||||||
A simple yet modern **Flask-based weather forecast application** that fetches real-time weather data from [OpenWeatherMap](https://openweathermap.org/) and provides a beautiful, responsive UI.
|
A simple modern **Flask-based weather forecast application** that fetches real-time weather data from [OpenWeatherMap](https://openweathermap.org/) and provides a beautiful, responsive UI. This project is **Dockerized** and supports **CI/CD deployment** to **Ghaymah Cloud** using the included shell script.
|
||||||
|
|
||||||
This project is **Dockerized** and supports **CI/CD deployment** to **Ghaymah Cloud** using the included shell script.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🚀 Features
|
## 🚀 Features
|
||||||
|
|
||||||
@@ -16,12 +13,12 @@ This project is **Dockerized** and supports **CI/CD deployment** to **Ghaymah Cl
|
|||||||
- 🐳 Dockerized for portability
|
- 🐳 Dockerized for portability
|
||||||
- ☁️ CI/CD ready with Ghaymah Cloud
|
- ☁️ CI/CD ready with Ghaymah Cloud
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📂 Project Structure
|
## 📂 Project Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
.
|
.
|
||||||
|
├── .github/workflows/cicd.yaml # GitHub Actions CI/CD workflow for my App
|
||||||
├── app.py # Flask application with weather API integration
|
├── app.py # Flask application with weather API integration
|
||||||
├── CICDpipeline.sh # CI/CD pipeline script for Docker + Ghaymah Cloud
|
├── CICDpipeline.sh # CI/CD pipeline script for Docker + Ghaymah Cloud
|
||||||
├── Dockerfile # Dockerfile to containerize the Flask app
|
├── Dockerfile # Dockerfile to containerize the Flask app
|
||||||
@@ -30,8 +27,6 @@ This project is **Dockerized** and supports **CI/CD deployment** to **Ghaymah Cl
|
|||||||
└── README.md # Documentation
|
└── README.md # Documentation
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## ⚙️ Prerequisites
|
## ⚙️ Prerequisites
|
||||||
|
|
||||||
Before running or deploying the app, ensure you have:
|
Before running or deploying the app, ensure you have:
|
||||||
@@ -41,8 +36,61 @@ Before running or deploying the app, ensure you have:
|
|||||||
- [Ghaymah CLI (`gy`)](https://docs.ghaymah.io) installed and configured
|
- [Ghaymah CLI (`gy`)](https://docs.ghaymah.io) installed and configured
|
||||||
- An [OpenWeatherMap API key](https://home.openweathermap.org/api_keys)
|
- An [OpenWeatherMap API key](https://home.openweathermap.org/api_keys)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 🖥️ On Your Terminal
|
||||||
|
|
||||||
|
1. **Install Ghaymah CLI**
|
||||||
|
```bash
|
||||||
|
curl -sSl https://cli.ghaymah.systems/install.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Navigate to Ghaymah Binary Directory & Create Project Files**
|
||||||
|
```bash
|
||||||
|
cd /ghaymah/bin
|
||||||
|
```
|
||||||
|
Create the following files:
|
||||||
|
- `Dockerfile`
|
||||||
|
- `index.html`
|
||||||
|
|
||||||
|
3. **Set Project Name**
|
||||||
|
```bash
|
||||||
|
gy r c p --set .name="project name"
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Initialize Project with Your Ghaymah Project ID**
|
||||||
|
```bash
|
||||||
|
gy r a init -p project-id
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **Copy Configuration File**
|
||||||
|
- Copy the generated `.ghaymah.json` file to your repository.
|
||||||
|
|
||||||
|
## 🌩️ On Your GitPasha Account
|
||||||
|
|
||||||
|
1. **Add Repository Secrets**
|
||||||
|
- `DOCKERHUB_USERNAME`
|
||||||
|
- `DOCKERHUB_PASSWORD`
|
||||||
|
- `GHAYMAH_EMAIL`
|
||||||
|
- `GHAYMAH_PASSWORD`
|
||||||
|
|
||||||
|
2. **Push Your Repository**
|
||||||
|
```bash
|
||||||
|
git add .
|
||||||
|
git commit -m "Initial commit for Ghaymah deployment"
|
||||||
|
git push origin main
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
✅ **Now your project is ready for automatic deployment via Ghaymah Cloud!**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 🛠️ Local Development
|
## 🛠️ Local Development
|
||||||
|
|
||||||
1. Clone this repository:
|
1. Clone this repository:
|
||||||
@@ -75,7 +123,7 @@ Before running or deploying the app, ensure you have:
|
|||||||
5. Open your browser at:
|
5. Open your browser at:
|
||||||
👉 http://127.0.0.1:5000
|
👉 http://127.0.0.1:5000
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🐳 Running with Docker
|
## 🐳 Running with Docker
|
||||||
|
|
||||||
@@ -94,9 +142,9 @@ Before running or deploying the app, ensure you have:
|
|||||||
3. Visit the app at:
|
3. Visit the app at:
|
||||||
👉 http://localhost:5000
|
👉 http://localhost:5000
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## ☁️ CI/CD Deployment to Ghaymah Cloud
|
|
||||||
|
# ☁️ Deployment to Ghaymah Cloud uisng **CICDpipeline.sh** Script
|
||||||
|
|
||||||
This project includes a **CICDpipeline.sh** script that:
|
This project includes a **CICDpipeline.sh** script that:
|
||||||
- Builds and tags Docker images
|
- Builds and tags Docker images
|
||||||
@@ -132,35 +180,4 @@ https://<your-app-name>.hosted.ghaymah.systems
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🧾 Environment Variables
|
|
||||||
|
|
||||||
Set your OpenWeatherMap API key (recommended):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export API_KEY="your_openweathermap_api_key"
|
|
||||||
```
|
|
||||||
|
|
||||||
If not set, a demo key will be used (limited requests).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📊 Health Check
|
|
||||||
|
|
||||||
Check if the app is running:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
curl http://localhost:5000/health
|
|
||||||
```
|
|
||||||
|
|
||||||
Example response:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"status": "healthy",
|
|
||||||
"timestamp": "2025-09-25T14:30:00"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم