Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
812989df47 | |||
452161ff03 | |||
cd3bf25fa1 |
@ -16,7 +16,7 @@ steps:
|
||||
scan_image:
|
||||
image: aquasec/trivy
|
||||
commands:
|
||||
- trivy image $FORGE_NAME/$CI_REPO:$CI_COMMIT_SHA --quiet --exit-code 1
|
||||
- TRIVY_DISABLE_VEX_NOTICE=1 trivy image $FORGE_NAME/$CI_REPO:$CI_COMMIT_SHA --quiet --exit-code 1
|
||||
when:
|
||||
- event: [push, tag]
|
||||
deploy:
|
||||
|
10
src/run.py
10
src/run.py
@ -37,14 +37,6 @@ oidc = OpenIDConnect(app)
|
||||
@app.route('/')
|
||||
@oidc.require_login
|
||||
def index():
|
||||
counter = int(session.get('counter', '0'))
|
||||
counter += 1
|
||||
session['counter'] = f"{counter}"
|
||||
return f"Hello, Flask! Called for the {counter}. time."
|
||||
|
||||
@app.route('/plot')
|
||||
@oidc.require_login
|
||||
def plot():
|
||||
try:
|
||||
dbh = psycopg.connect()
|
||||
engine = sqlalchemy.create_engine("postgresql+psycopg://", creator=lambda: dbh)
|
||||
@ -63,6 +55,7 @@ def plot():
|
||||
yaxis=dict(ticksuffix=" kWh")
|
||||
)
|
||||
graph_html = fig.to_html(full_html=False)
|
||||
graph_html_2 = fig.to_html(full_html=False)
|
||||
|
||||
return render_template_string(f"""
|
||||
<html>
|
||||
@ -71,6 +64,7 @@ def plot():
|
||||
</head>
|
||||
<body>
|
||||
{graph_html}
|
||||
{graph_html_2}
|
||||
</body>
|
||||
</html>
|
||||
""")
|
||||
|
Reference in New Issue
Block a user