feat: Complete CICD implementation with Gitea Actions and Kubernetes deployment
✨ Features: - Gitea Actions runners registered (docker + kubernetes) - Complete CICD workflow (.gitea/workflows/cicd.yml) - Build & test pipeline with parallel execution - Harbor registry integration (localhost:8443) - Kubernetes deployment to claude-stock namespace - K8s to host Ollama connectivity via Node IP - Comprehensive documentation and deployment scripts 🔧 Components: - Workflow definitions for build, test, security scan, deploy, smoke test - K8s manifests: namespace, deployment, service, configmap - Deploy scripts: deploy-to-k8s.sh, verify-cicd.sh - Documentation: QUICK_START.md, CICD_DEPLOYMENT_GUIDE.md 📋 Documentation: - Created .gitea_secrets_setup.md for manual secret configuration - Updated with Gitea Runners setup instructions 🎯 Next Steps: 1. Create 5 secrets in Gitea UI (see .gitea_secrets_setup.md) 2. Push code to trigger CICD: git push origin main 3. Monitor workflow in: http://192.168.1.83:33000/root/stock/actions 4. Verify K8s deployment: kubectl get pods -n claude-stock 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
This commit is contained in:
@@ -37,7 +37,9 @@
|
||||
"Bash(__NEW_LINE__ curl -s -X POST http://localhost:8001/api/collab/recommend -H \"Content-Type: application/json\" -d '{\"\"\"\"symbol\"\"\"\": \"\"\"\"EURUSD=X\"\"\"\"}')",
|
||||
"Bash(timeout:*)",
|
||||
"Bash(kubectl cluster-info:*)",
|
||||
"Bash(chmod:*)"
|
||||
"Bash(chmod:*)",
|
||||
"Bash(git reset:*)",
|
||||
"Bash(export GITEA_RUNNER_TOKEN=e9udfPmR6PsKbTXNRY61fMiGpmVBXv1PRKhbTfPD)"
|
||||
],
|
||||
"deny": [],
|
||||
"ask": []
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
# Gitea Repository Secrets Setup Guide
|
||||
|
||||
## Required Secrets
|
||||
|
||||
You need to create the following secrets in Gitea for the CICD workflow to work properly.
|
||||
|
||||
### How to Create Secrets
|
||||
|
||||
1. Go to: `http://192.168.1.83:33000/root/stock/settings/secrets`
|
||||
2. Click "Add Secret"
|
||||
3. Fill in the name and value
|
||||
4. Click "Save"
|
||||
|
||||
### Required Secrets
|
||||
|
||||
#### 1. HARBOR_PASSWORD
|
||||
- **Name:** `HARBOR_PASSWORD`
|
||||
- **Value:** `Harbor12345`
|
||||
- **Purpose:** Docker login to push images to Harbor registry
|
||||
|
||||
#### 2. KUBECONFIG
|
||||
- **Name:** `KUBECONFIG`
|
||||
- **Value:** (Base64 encoded kubectl config)
|
||||
- **How to get:**
|
||||
```bash
|
||||
cat ~/.kube/config | base64 | tr -d '\n'
|
||||
```
|
||||
- **Purpose:** Kubernetes deployment authentication
|
||||
|
||||
#### 3. OPENROUTER_API_KEY
|
||||
- **Name:** `OPENROUTER_API_KEY`
|
||||
- **Value:** `sk-or-v1-xxxx...` (your actual key)
|
||||
- **Purpose:** Claude API access for AI features
|
||||
|
||||
#### 4. TUSHARE_TOKEN
|
||||
- **Name:** `TUSHARE_TOKEN`
|
||||
- **Value:** `your-tushare-token`
|
||||
- **Purpose:** TuShare stock data API access
|
||||
|
||||
#### 5. ALPHA_VANTAGE_API_KEY
|
||||
- **Name:** `ALPHA_VANTAGE_API_KEY`
|
||||
- **Value:** `FFJVQK6LCQ5RSPNH`
|
||||
- **Purpose:** Alpha Vantage API for stock and forex data
|
||||
|
||||
## Quick Setup Script
|
||||
|
||||
If you have Gitea admin token, you can create secrets programmatically:
|
||||
|
||||
```bash
|
||||
export GITEA_TOKEN="your_admin_token"
|
||||
export GITEA_URL="http://192.168.1.83:33000"
|
||||
|
||||
# Create each secret
|
||||
curl -X POST \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"data":"Harbor12345"}' \
|
||||
"$GITEA_URL/api/v1/repos/root/stock/secrets/HARBOR_PASSWORD"
|
||||
```
|
||||
|
||||
## Verification
|
||||
|
||||
After creating all secrets, verify in Gitea UI:
|
||||
- Go to Repository Settings > Secrets
|
||||
- You should see all 5 secrets listed
|
||||
|
||||
## Next Steps
|
||||
|
||||
Once all secrets are configured:
|
||||
1. Push code to trigger CICD: `git push origin main`
|
||||
2. Monitor workflow in: http://192.168.1.83:33000/root/stock/actions
|
||||
3. Check deployment status in Kubernetes: `kubectl get pods -n claude-stock`
|
||||
|
||||
Reference in New Issue
Block a user