Nightscout-koppeling + CI/CD-fixes #2
@@ -0,0 +1,8 @@
|
||||
.env
|
||||
.venv/
|
||||
__pycache__/
|
||||
*.pyc
|
||||
.git/
|
||||
.pytest_cache/
|
||||
.ruff_cache/
|
||||
tests/
|
||||
@@ -47,23 +47,23 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build Docker image
|
||||
run: docker build -t gitea.thuis.local/willem/glucose-dashboard:${{ gitea.sha }} .
|
||||
run: docker build -t gitea.zb.local/willem/glucose-dashboard:${{ gitea.sha }} .
|
||||
|
||||
- name: Trivy scan
|
||||
uses: aquasecurity/trivy-action@master
|
||||
with:
|
||||
image-ref: gitea.thuis.local/willem/glucose-dashboard:${{ gitea.sha }}
|
||||
image-ref: gitea.zb.local/willem/glucose-dashboard:${{ gitea.sha }}
|
||||
severity: CRITICAL,HIGH
|
||||
exit-code: "1" # laat de pipeline falen bij kritieke kwetsbaarheden
|
||||
|
||||
- name: Login bij Gitea-registry
|
||||
run: echo "${{ secrets.GLUCOSE_TOKEN }}" | docker login gitea.thuis.local -u willem --password-stdin
|
||||
run: echo "${{ secrets.GLUCOSE_TOKEN }}" | docker login gitea.zb.local -u willem --password-stdin
|
||||
|
||||
- name: Tag en push
|
||||
run: |
|
||||
docker tag gitea.thuis.local/willem/glucose-dashboard:${{ gitea.sha }} gitea.thuis.local/willem/glucose-dashboard:latest
|
||||
docker push gitea.thuis.local/willem/glucose-dashboard:${{ gitea.sha }}
|
||||
docker push gitea.thuis.local/willem/glucose-dashboard:latest
|
||||
docker tag gitea.zb.local/willem/glucose-dashboard:${{ gitea.sha }} gitea.zb.local/willem/glucose-dashboard:latest
|
||||
docker push gitea.zb.local/willem/glucose-dashboard:${{ gitea.sha }}
|
||||
docker push gitea.zb.local/willem/glucose-dashboard:latest
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# 4. Deploy — SSH naar de LXC en herstart met de nieuwe image
|
||||
|
||||
@@ -4,3 +4,4 @@ __pycache__/
|
||||
.env
|
||||
.pytest_cache/
|
||||
.ruff_cache/
|
||||
homelab-cicd-werkinstructie.md
|
||||
@@ -10,14 +10,15 @@ koolhydraten en pomp-/sensorwissels overlay, plus time-in-range-cijfers.
|
||||
> Manage Tokens in Nightscout — geef het token minimaal `readable`-rechten)
|
||||
of het klassieke API secret.
|
||||
2. Kopieer `.env.example` naar `.env` en vul `NIGHTSCOUT_URL` en één van de
|
||||
twee auth-opties in.
|
||||
twee auth-opties in. `app.py` laadt `.env` zelf in (via `python-dotenv`),
|
||||
dus dit werkt hetzelfde onder PowerShell, cmd of bash — je hoeft de
|
||||
variabelen niet zelf in je shell te zetten.
|
||||
3. Lokaal draaien:
|
||||
|
||||
```bash
|
||||
```powershell
|
||||
uv venv
|
||||
uv pip install -r requirements.txt
|
||||
set -a; source .env; set +a # of: laad de vars op je eigen manier
|
||||
streamlit run app.py
|
||||
uv pip install -r requirements.txt --python .venv
|
||||
.venv\Scripts\streamlit run app.py
|
||||
```
|
||||
|
||||
4. Met Docker Compose:
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
glucose-dashboard:
|
||||
image: gitea.thuis.local/willem/glucose-dashboard:latest
|
||||
image: gitea.zb.local/willem/glucose-dashboard:latest
|
||||
container_name: glucose-dashboard
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
|
||||
Reference in New Issue
Block a user