Compare commits
2 Commits
b13a4fe400
...
19e182c53b
Author | SHA1 | Date | |
---|---|---|---|
19e182c53b | |||
505c65f614 |
@@ -14,7 +14,7 @@ env:
|
|||||||
REGISTRY: git.b4l.co.th
|
REGISTRY: git.b4l.co.th
|
||||||
IMAGE_NAME: b4l/northern-thailand-ping-river-monitor
|
IMAGE_NAME: b4l/northern-thailand-ping-river-monitor
|
||||||
# GitHub token for better rate limits and authentication
|
# GitHub token for better rate limits and authentication
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Test job
|
# Test job
|
||||||
@@ -44,9 +44,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip --root-user-action=ignore
|
||||||
pip install -r requirements.txt
|
pip install --root-user-action=ignore -r requirements.txt
|
||||||
pip install -r requirements-dev.txt
|
pip install --root-user-action=ignore -r requirements-dev.txt
|
||||||
|
|
||||||
- name: Lint with flake8
|
- name: Lint with flake8
|
||||||
run: |
|
run: |
|
||||||
@@ -106,8 +106,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip --root-user-action=ignore
|
||||||
pip install -r requirements-dev.txt
|
pip install --root-user-action=ignore -r requirements-dev.txt
|
||||||
|
|
||||||
- name: Run safety check
|
- name: Run safety check
|
||||||
run: |
|
run: |
|
||||||
@@ -167,7 +167,7 @@ jobs:
|
|||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
- name: Test Docker image
|
- name: Test Docker image
|
||||||
run: |
|
run: |
|
||||||
@@ -205,8 +205,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip --root-user-action=ignore
|
||||||
pip install -r requirements.txt
|
pip install --root-user-action=ignore -r requirements.txt
|
||||||
|
|
||||||
- name: Test with VictoriaMetrics
|
- name: Test with VictoriaMetrics
|
||||||
env:
|
env:
|
||||||
|
@@ -248,8 +248,8 @@ jobs:
|
|||||||
project = 'Northern Thailand Ping River Monitor'
|
project = 'Northern Thailand Ping River Monitor'
|
||||||
copyright = '2025, Ping River Monitor Team'
|
copyright = '2025, Ping River Monitor Team'
|
||||||
author = 'Ping River Monitor Team'
|
author = 'Ping River Monitor Team'
|
||||||
version = '3.1.0'
|
version = '3.1.1'
|
||||||
release = '3.1.0'
|
release = '3.1.1'
|
||||||
|
|
||||||
extensions = [
|
extensions = [
|
||||||
'sphinx.ext.autodoc',
|
'sphinx.ext.autodoc',
|
||||||
|
@@ -7,7 +7,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: 'Release version (e.g., v3.1.0)'
|
description: 'Release version (e.g., v3.1.1)'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ env:
|
|||||||
REGISTRY: git.b4l.co.th
|
REGISTRY: git.b4l.co.th
|
||||||
IMAGE_NAME: b4l/northern-thailand-ping-river-monitor
|
IMAGE_NAME: b4l/northern-thailand-ping-river-monitor
|
||||||
# GitHub token for better rate limits and authentication
|
# GitHub token for better rate limits and authentication
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Create release
|
# Create release
|
||||||
@@ -83,9 +83,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip --root-user-action=ignore
|
||||||
pip install -r requirements.txt
|
pip install --root-user-action=ignore -r requirements.txt
|
||||||
pip install -r requirements-dev.txt
|
pip install --root-user-action=ignore -r requirements-dev.txt
|
||||||
|
|
||||||
- name: Run full test suite
|
- name: Run full test suite
|
||||||
run: |
|
run: |
|
||||||
@@ -95,7 +95,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Python package
|
- name: Build Python package
|
||||||
run: |
|
run: |
|
||||||
pip install build
|
pip install --root-user-action=ignore build
|
||||||
python -m build
|
python -m build
|
||||||
|
|
||||||
- name: Upload Python package
|
- name: Upload Python package
|
||||||
@@ -160,9 +160,9 @@ jobs:
|
|||||||
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.create-release.outputs.version }}
|
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.create-release.outputs.version }}
|
||||||
format: 'sarif'
|
format: 'sarif'
|
||||||
output: 'trivy-results.sarif'
|
output: 'trivy-results.sarif'
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GH_TOKEN }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
- name: Upload Trivy scan results
|
- name: Upload Trivy scan results
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
@@ -14,7 +14,7 @@ on:
|
|||||||
env:
|
env:
|
||||||
PYTHON_VERSION: "3.11"
|
PYTHON_VERSION: "3.11"
|
||||||
# GitHub token for better rate limits and authentication
|
# GitHub token for better rate limits and authentication
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Dependency vulnerability scan
|
# Dependency vulnerability scan
|
||||||
@@ -33,8 +33,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip --root-user-action=ignore
|
||||||
pip install safety bandit semgrep
|
pip install --root-user-action=ignore safety bandit semgrep
|
||||||
|
|
||||||
- name: Run Safety check
|
- name: Run Safety check
|
||||||
run: |
|
run: |
|
||||||
@@ -95,18 +95,18 @@ jobs:
|
|||||||
|
|
||||||
- name: Check GitHub token availability
|
- name: Check GitHub token availability
|
||||||
run: |
|
run: |
|
||||||
if [ -z "${{ secrets.GITHUB_TOKEN }}" ]; then
|
if [ -z "${{ secrets.GH_TOKEN }}" ]; then
|
||||||
echo "⚠️ GITHUB_TOKEN not configured. Trivy scans may fail due to rate limits."
|
echo "⚠️ GH_TOKEN not configured. Trivy scans may fail due to rate limits."
|
||||||
echo "💡 To fix: Add GITHUB_TOKEN secret in repository settings"
|
echo "💡 To fix: Add GH_TOKEN secret in repository settings"
|
||||||
else
|
else
|
||||||
echo "✅ GITHUB_TOKEN is configured"
|
echo "✅ GH_TOKEN is configured"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Build Docker image for scanning
|
- name: Build Docker image for scanning
|
||||||
run: |
|
run: |
|
||||||
docker build -t ping-river-monitor:scan .
|
docker build -t ping-river-monitor:scan .
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner
|
- name: Run Trivy vulnerability scanner
|
||||||
uses: aquasecurity/trivy-action@master
|
uses: aquasecurity/trivy-action@master
|
||||||
@@ -114,9 +114,9 @@ jobs:
|
|||||||
image-ref: "ping-river-monitor:scan"
|
image-ref: "ping-river-monitor:scan"
|
||||||
format: "json"
|
format: "json"
|
||||||
output: "trivy-report.json"
|
output: "trivy-report.json"
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GH_TOKEN }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Run Trivy filesystem scan
|
- name: Run Trivy filesystem scan
|
||||||
@@ -126,9 +126,9 @@ jobs:
|
|||||||
scan-ref: "."
|
scan-ref: "."
|
||||||
format: "json"
|
format: "json"
|
||||||
output: "trivy-fs-report.json"
|
output: "trivy-fs-report.json"
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GH_TOKEN }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Upload Trivy reports
|
- name: Upload Trivy reports
|
||||||
@@ -177,9 +177,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Install pip-licenses
|
- name: Install pip-licenses
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip --root-user-action=ignore
|
||||||
pip install pip-licenses
|
pip install --root-user-action=ignore pip-licenses
|
||||||
pip install -r requirements.txt
|
pip install --root-user-action=ignore -r requirements.txt
|
||||||
|
|
||||||
- name: Check licenses
|
- name: Check licenses
|
||||||
run: |
|
run: |
|
||||||
@@ -222,13 +222,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Install pip-check-updates equivalent
|
- name: Install pip-check-updates equivalent
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip --root-user-action=ignore
|
||||||
pip install pip-review
|
pip install --root-user-action=ignore pip-review
|
||||||
|
|
||||||
- name: Check for outdated packages
|
- name: Check for outdated packages
|
||||||
run: |
|
run: |
|
||||||
echo "📦 Checking for outdated packages..."
|
echo "📦 Checking for outdated packages..."
|
||||||
pip install -r requirements.txt
|
pip install --root-user-action=ignore -r requirements.txt
|
||||||
pip list --outdated --format=json > outdated-packages.json || true
|
pip list --outdated --format=json > outdated-packages.json || true
|
||||||
|
|
||||||
if [ -s outdated-packages.json ]; then
|
if [ -s outdated-packages.json ]; then
|
||||||
@@ -303,9 +303,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Install quality tools
|
- name: Install quality tools
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip --root-user-action=ignore
|
||||||
pip install radon xenon vulture
|
pip install --root-user-action=ignore radon xenon vulture
|
||||||
pip install -r requirements.txt
|
pip install --root-user-action=ignore -r requirements.txt
|
||||||
|
|
||||||
- name: Calculate code complexity
|
- name: Calculate code complexity
|
||||||
run: |
|
run: |
|
||||||
|
@@ -259,7 +259,7 @@ make health-check
|
|||||||
|
|
||||||
**Deployment Date**: ___________
|
**Deployment Date**: ___________
|
||||||
**Deployed By**: ___________
|
**Deployed By**: ___________
|
||||||
**Version**: v3.1.0
|
**Version**: v3.1.1
|
||||||
**Environment**: ___________
|
**Environment**: ___________
|
||||||
|
|
||||||
**Sign-off**:
|
**Sign-off**:
|
||||||
|
@@ -222,12 +222,12 @@ Your repository is now equipped with:
|
|||||||
2. **Configure deployment environments** (staging/production)
|
2. **Configure deployment environments** (staging/production)
|
||||||
3. **Set up monitoring dashboards** for workflow metrics
|
3. **Set up monitoring dashboards** for workflow metrics
|
||||||
4. **Configure notifications** for team collaboration
|
4. **Configure notifications** for team collaboration
|
||||||
5. **Create your first release** with `git tag v3.1.0`
|
5. **Create your first release** with `git tag v3.1.1`
|
||||||
|
|
||||||
Your **Northern Thailand Ping River Monitor** is now ready for professional development and deployment! 🎊
|
Your **Northern Thailand Ping River Monitor** is now ready for professional development and deployment! 🎊
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Workflow Version**: v3.1.0
|
**Workflow Version**: v3.1.1
|
||||||
**Setup Date**: 2025-08-12
|
**Setup Date**: 2025-08-12
|
||||||
**Repository**: https://git.b4l.co.th/grabowski/Northern-Thailand-Ping-River-Monitor
|
**Repository**: https://git.b4l.co.th/grabowski/Northern-Thailand-Ping-River-Monitor
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
A comprehensive real-time water level monitoring system for the Ping River Basin in Northern Thailand, covering Royal Irrigation Department (RID) stations from Chiang Dao to Nakhon Sawan with advanced data collection, storage, and visualization capabilities.
|
A comprehensive real-time water level monitoring system for the Ping River Basin in Northern Thailand, covering Royal Irrigation Department (RID) stations from Chiang Dao to Nakhon Sawan with advanced data collection, storage, and visualization capabilities.
|
||||||
|
|
||||||
[](https://git.b4l.co.th/B4L/Northern-Thailand-Ping-River-Monitor/actions) [](https://git.b4l.co.th/B4L/Northern-Thailand-Ping-River-Monitor/actions) [](https://git.b4l.co.th/B4L/Northern-Thailand-Ping-River-Monitor/actions) [](https://python.org) [](https://fastapi.tiangolo.com) [](https://docker.com) [](LICENSE) [](https://git.b4l.co.th/B4L/Northern-Thailand-Ping-River-Monitor/releases)
|
[](https://git.b4l.co.th/B4L/Northern-Thailand-Ping-River-Monitor/actions) [](https://git.b4l.co.th/B4L/Northern-Thailand-Ping-River-Monitor/actions) [](https://git.b4l.co.th/B4L/Northern-Thailand-Ping-River-Monitor/actions) [](https://python.org) [](https://fastapi.tiangolo.com) [](https://docker.com) [](LICENSE) [](https://git.b4l.co.th/B4L/Northern-Thailand-Ping-River-Monitor/releases)
|
||||||
|
|
||||||
## 🌟 Features
|
## 🌟 Features
|
||||||
|
|
||||||
|
@@ -297,6 +297,6 @@ make validate-workflows
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Workflow Version**: v3.1.0
|
**Workflow Version**: v3.1.1
|
||||||
**Last Updated**: 2025-08-12
|
**Last Updated**: 2025-08-12
|
||||||
**Maintained By**: Ping River Monitor Team
|
**Maintained By**: Ping River Monitor Team
|
@@ -29,7 +29,7 @@ def main():
|
|||||||
"FastAPI": generate_badge_url("FastAPI", "0.104%2B", "green"),
|
"FastAPI": generate_badge_url("FastAPI", "0.104%2B", "green"),
|
||||||
"Docker": generate_badge_url("Docker", "Ready", "blue"),
|
"Docker": generate_badge_url("Docker", "Ready", "blue"),
|
||||||
"License": generate_badge_url("License", "MIT", "green"),
|
"License": generate_badge_url("License", "MIT", "green"),
|
||||||
"Version": generate_badge_url("Version", "v3.1.0", "blue"),
|
"Version": generate_badge_url("Version", "v3.1.1", "blue"),
|
||||||
}
|
}
|
||||||
|
|
||||||
print("# Status Badges")
|
print("# Status Badges")
|
||||||
|
@@ -13,7 +13,7 @@ REM Add all files
|
|||||||
git add .
|
git add .
|
||||||
|
|
||||||
REM Initial commit
|
REM Initial commit
|
||||||
git commit -m "Initial commit: Northern Thailand Ping River Monitor v3.1.0
|
git commit -m "Initial commit: Northern Thailand Ping River Monitor v3.1.1
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
- Real-time water level monitoring for Ping River Basin
|
- Real-time water level monitoring for Ping River Basin
|
||||||
|
@@ -66,7 +66,7 @@ fi
|
|||||||
git add .
|
git add .
|
||||||
|
|
||||||
# Initial commit
|
# Initial commit
|
||||||
git commit -m "Initial commit: Northern Thailand Ping River Monitor v3.1.0
|
git commit -m "Initial commit: Northern Thailand Ping River Monitor v3.1.1
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
- Real-time water level monitoring for Ping River Basin
|
- Real-time water level monitoring for Ping River Basin
|
||||||
|
2
setup.py
2
setup.py
@@ -22,7 +22,7 @@ for req in requirements:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="northern-thailand-ping-river-monitor",
|
name="northern-thailand-ping-river-monitor",
|
||||||
version="3.1.0",
|
version="3.1.1",
|
||||||
author="Ping River Monitor Team",
|
author="Ping River Monitor Team",
|
||||||
author_email="contact@example.com",
|
author_email="contact@example.com",
|
||||||
description="Real-time water level monitoring system for the Ping River Basin in Northern Thailand",
|
description="Real-time water level monitoring system for the Ping River Basin in Northern Thailand",
|
||||||
|
@@ -6,7 +6,7 @@ A comprehensive real-time water level monitoring system for the Ping River Basin
|
|||||||
in Northern Thailand, covering Royal Irrigation Department (RID) stations.
|
in Northern Thailand, covering Royal Irrigation Department (RID) stations.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = "3.1.0"
|
__version__ = "3.1.1"
|
||||||
__author__ = "Ping River Monitor Team"
|
__author__ = "Ping River Monitor Team"
|
||||||
__description__ = "Northern Thailand Ping River Monitoring System"
|
__description__ = "Northern Thailand Ping River Monitoring System"
|
||||||
|
|
||||||
|
@@ -297,7 +297,7 @@ Examples:
|
|||||||
)
|
)
|
||||||
|
|
||||||
logger.info("🏔️ Northern Thailand Ping River Monitor starting...")
|
logger.info("🏔️ Northern Thailand Ping River Monitor starting...")
|
||||||
logger.info(f"Version: 3.1.0")
|
logger.info(f"Version: 3.1.1")
|
||||||
logger.info(f"Log level: {args.log_level}")
|
logger.info(f"Log level: {args.log_level}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@@ -143,7 +143,7 @@ async def lifespan(app: FastAPI):
|
|||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="Northern Thailand Ping River Monitor API",
|
title="Northern Thailand Ping River Monitor API",
|
||||||
description="Real-time water level monitoring system for Northern Thailand's Ping River Basin stations",
|
description="Real-time water level monitoring system for Northern Thailand's Ping River Basin stations",
|
||||||
version="3.1.0",
|
version="3.1.1",
|
||||||
lifespan=lifespan
|
lifespan=lifespan
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -165,7 +165,7 @@ def test_logging():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Run all tests"""
|
"""Run all tests"""
|
||||||
print("🧪 Running integration tests for Northern Thailand Ping River Monitor v3.1.0")
|
print("🧪 Running integration tests for Northern Thailand Ping River Monitor v3.1.1")
|
||||||
print("=" * 60)
|
print("=" * 60)
|
||||||
|
|
||||||
tests = [
|
tests = [
|
||||||
|
Reference in New Issue
Block a user