new version 1.1
All checks were successful
CI/CD Pipeline / build (push) Successful in 1m27s
CI/CD Pipeline / deploy (push) Successful in 2m9s

This commit is contained in:
2026-04-30 17:34:02 +02:00
parent 38388223ec
commit 3b46662807
2 changed files with 12 additions and 11 deletions

View File

@@ -18,7 +18,7 @@ spec:
- name: gitea-creds
containers:
- name: helloo-cicdd
image: git.fpmoz.sum.ba/Marijanela218/helloo-cicdd:latest
image: git.fpmoz.sum.ba/Marijanela218/helloo-cicdd:1.1
ports:
- containerPort: 8000
# ── Liveness: je li proces živ? ─────────────────

21
main.py
View File

@@ -3,16 +3,17 @@ from fastapi import FastAPI
import os, datetime
app = FastAPI()
_healthy = True
@app.get("/health")
def health():
return {
"status": "ok",
"version": os.getenv("APP_VERSION", "dev"),
"timestamp": datetime.datetime.utcnow().isoformat()
}
@app.get("/")
def root():
return {"poruka": "Zdravo s k3s!", "host": os.uname().nodename}
if not _healthy:
return {"status": "unhealthy"}, 503
return {"status": "ok"}
@app.post("/break")
def break_health():
"""Simulira pad servisa za testiranje liveness probe-a"""
global _healthy
_healthy = False
return {"message": "Servis je sada nezdrav — ocekuj restart"}