build process (via Dockerfile) now timestamps build and that is exposed on about page

This commit is contained in:
2023-01-03 11:46:53 +11:00
parent be3e2ae19e
commit 0684f4725a
4 changed files with 16 additions and 5 deletions

View File

@@ -20,7 +20,8 @@ RUN pip3 install --upgrade pillow --user
EXPOSE 443 EXPOSE 443
EXPOSE 55432 EXPOSE 55432
COPY . . COPY . .
RUN git log -n 15 > ./internal/git-log.txt RUN date > internal/build-date.txt
RUN git log -n 15 > internal/git-log.txt
RUN ln -s /code/TODO /code/internal/TODO RUN ln -s /code/TODO /code/internal/TODO
RUN ln -s /code/BUGs /code/internal/BUGs RUN ln -s /code/BUGs /code/internal/BUGs
RUN rm -rf .git RUN rm -rf .git

2
TODO
View File

@@ -1,6 +1,4 @@
## GENERAL ## GENERAL
* get Dockerfile to timestamp when it ran so Built on in about page is accurate (not the last commit time)
* after move, instead of back to home page, go to an ammended view of the thumbs to keep moving * after move, instead of back to home page, go to an ammended view of the thumbs to keep moving
* ignore face should ignore ALL matching faces (re: Declan) * ignore face should ignore ALL matching faces (re: Declan)

14
main.py
View File

@@ -199,7 +199,19 @@ def about():
todo=fp.read() todo=fp.read()
except FileNotFoundError: except FileNotFoundError:
todo="No TODOs defined - cannot find TODO file!?" todo="No TODOs defined - cannot find TODO file!?"
return render_template("about.html", commits=commits, bugs=bugs, todo=todo) try:
with open( 'internal/build-date.txt', 'r' ) as fp:
if 'ENV' in os.environ:
build_info=os.environ['ENV']
else:
build_info="Development"
build_info = build_info + " version built on: " + fp.read()
except FileNotFoundError:
if 'ENV' not in os.environ or os.environ['ENV'] == "development":
build_info="Development version"
else:
build_info="No build info found!?"
return render_template("about.html", commits=commits, bugs=bugs, todo=todo, build_info=build_info)
@app.route('/logout') @app.route('/logout')
@login_required @login_required

View File

@@ -7,7 +7,7 @@
{# <svg width="64" height="64" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#pa_logo" /></svg>&nbsp;About Photo Assistant</h3> #} {# <svg width="64" height="64" fill="currentColor"><use xlink:href="{{url_for('internal', filename='icons.svg')}}#pa_logo" /></svg>&nbsp;About Photo Assistant</h3> #}
<svg width="64" height="64" fill="currentColor"><use xlink:href="internal/icons.svg#pa_logo" /></svg>&nbsp;Photo Assistant - About</h3> <svg width="64" height="64" fill="currentColor"><use xlink:href="internal/icons.svg#pa_logo" /></svg>&nbsp;Photo Assistant - About</h3>
<div class="alert alert-info"> <div class="alert alert-info">
Built on: {{commits[0].date}} {{build_info}}
</div> </div>
</div> </div>
<h5><b> <h5><b>