Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
77ac8fecb2
|
|||
|
093805a249
|
|||
|
cab9ed705e
|
|||
|
2faa19bc54
|
@@ -14,41 +14,6 @@ steps:
|
||||
when:
|
||||
- event: tag
|
||||
|
||||
scan:
|
||||
image: quay.io/wollud1969/woodpecker-helper:0.5.1
|
||||
environment:
|
||||
TRIVY_TOKEN:
|
||||
from_secret: trivy_token
|
||||
TRIVY_URL:
|
||||
from_secret: trivy_url
|
||||
DTRACK_API_KEY:
|
||||
from_secret: dtrack_api_key
|
||||
DTRACK_API_URL:
|
||||
from_secret: dtrack_api_url
|
||||
commands:
|
||||
- HOME=/home/`id -nu`
|
||||
- TAG="${CI_COMMIT_TAG}"
|
||||
- |
|
||||
trivy image \
|
||||
--server $TRIVY_URL \
|
||||
--token $TRIVY_TOKEN \
|
||||
--format cyclonedx \
|
||||
--scanners license \
|
||||
--output /tmp/sbom.xml \
|
||||
$FORGE_NAME/$CI_REPO:$TAG
|
||||
- cat /tmp/sbom.xml
|
||||
- |
|
||||
curl -X "POST" \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-H "X-Api-Key: $DTRACK_API_KEY" \
|
||||
-F "autoCreate=true" \
|
||||
-F "projectName=$CI_REPO" \
|
||||
-F "projectVersion=$TAG" \
|
||||
-F "bom=@/tmp/sbom.xml"\
|
||||
"$DTRACK_API_URL/api/v1/bom"
|
||||
when:
|
||||
- event: [push, tag]
|
||||
|
||||
deploy:
|
||||
image: quay.io/wollud1969/k8s-admin-helper:0.4.1
|
||||
environment:
|
||||
|
||||
4
deployment/encrypt-secrets.sh
Executable file
4
deployment/encrypt-secrets.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
gpg --pinentry-mode=loopback --symmetric --cipher-algo AES256 --armor --output secrets.asc secrets.txt
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
-----BEGIN PGP MESSAGE-----
|
||||
|
||||
jA0ECQMC4tvOF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PGBnZrbPFwcKVKxvqS+98K/QmTzqQfvZiu
|
||||
0ZHYE57QiLcSKKonih2224KvnJkfzibYiHaxY8pWoYGDCSg5wM7PmeXBUg6Z7paP
|
||||
xz78RiWSKyivZ7TGmlDb+UIE4qLL4tJiqbUJ/Q7HuQceLjMJaxTsbQWLMPxI+Ooh
|
||||
0rouXg6YjPacItBmdJJsW+tnvV4wMNrM5bLlQN7myoLg8WSZHOsGbDIcc6DL1GxN
|
||||
6pEFpZsCO5fphJoZcTdwop/wKXhptQBm/M2FqRzQziDsofse8vRCUFCn2fY9oRWI
|
||||
H4Kbf+xa78nfoYpRx+uH4pbWTRIZ/XJu7Oq438kNlFd2QdA8hJk2yvE0FNnsa7Xa
|
||||
LnTwX+wmFPb/LyKLe94tffm5CEIcLgOrWIgTufp8/eBfjbj3fSui5PY=
|
||||
=nOkj
|
||||
-----END PGP MESSAGE-----
|
||||
|
||||
@@ -16,21 +16,13 @@ from app import oidc
|
||||
@oidc.require_login
|
||||
def pvstats():
|
||||
try:
|
||||
stepX_time = time.time()
|
||||
dbh = psycopg.connect()
|
||||
engine = sqlalchemy.create_engine("postgresql+psycopg://", creator=lambda: dbh)
|
||||
|
||||
step0_time = time.time()
|
||||
df = pd.read_sql("SELECT month, cast(year AS varchar), current_energy AS value FROM pv_energy_by_month", con=engine)
|
||||
step1_time = time.time()
|
||||
duration1 = step1_time - step0_time
|
||||
logger.info(f"{duration1=}")
|
||||
df = pd.read_sql("SELECT month, cast(year AS varchar), current_energy AS value FROM pv_energy_by_month ORDER BY year, month", con=engine)
|
||||
fig_1 = px.bar(df, x='month', y='value', color='year', barmode='group')
|
||||
step2_time = time.time()
|
||||
duration2 = step2_time - step1_time
|
||||
logger.info(f"{duration2=}")
|
||||
fig_1.update_layout(
|
||||
title=f"Jahreswerte Exportierte Energie {duration1:.3f}, {duration2:.3f}",
|
||||
title=f"Jahreswerte Exportierte Energie PV-Anlage",
|
||||
xaxis_title="",
|
||||
yaxis_title="",
|
||||
legend_title="Jahr",
|
||||
@@ -43,18 +35,34 @@ def pvstats():
|
||||
)
|
||||
graph_html_1 = fig_1.to_html(full_html=False, default_height='30%')
|
||||
|
||||
df = pd.read_sql("SELECT month, cast(year AS varchar), current_energy AS value FROM car_energy_by_month ORDER BY year, month", con=engine)
|
||||
fig_2 = px.bar(df, x='month', y='value', color='year', barmode='group')
|
||||
fig_2.update_layout(
|
||||
title=f"Jahreswerte Verbrauch Elektroauto",
|
||||
xaxis_title="",
|
||||
yaxis_title="",
|
||||
legend_title="Jahr",
|
||||
xaxis=dict(
|
||||
tickmode="array",
|
||||
tickvals=list(range(1, 13)), # Monate 1–12
|
||||
ticktext=["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"]
|
||||
),
|
||||
yaxis=dict(ticksuffix=" kWh")
|
||||
)
|
||||
graph_html_2 = fig_2.to_html(full_html=False, default_height='30%')
|
||||
return render_template_string(f"""
|
||||
<html>
|
||||
<head>
|
||||
<title>Jahreswerte PV-Energie</title>
|
||||
<title>Jahreswerte PV und Auto</title>
|
||||
</head>
|
||||
<body>
|
||||
{graph_html_1}
|
||||
{graph_html_2}
|
||||
</body>
|
||||
</html>
|
||||
""")
|
||||
except Exception as e:
|
||||
raise Exception(f"Error when querying energy export values: {e}")
|
||||
raise Exception(f"Error when querying energy values: {e}")
|
||||
finally:
|
||||
if dbh is not None:
|
||||
dbh.close()
|
||||
|
||||
Reference in New Issue
Block a user