diff --git a/Dockerfile b/Dockerfile index ac4ea2d..913e6cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,8 @@ RUN pip3 install --upgrade pillow --user EXPOSE 443 EXPOSE 55432 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/BUGs /code/internal/BUGs RUN rm -rf .git diff --git a/TODO b/TODO index b86ab6c..617fe7e 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,4 @@ ## 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 * ignore face should ignore ALL matching faces (re: Declan) diff --git a/main.py b/main.py index 1c4d8ec..a710133 100644 --- a/main.py +++ b/main.py @@ -199,7 +199,19 @@ def about(): todo=fp.read() except FileNotFoundError: 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') @login_required diff --git a/templates/about.html b/templates/about.html index 9716886..dd1fd5a 100644 --- a/templates/about.html +++ b/templates/about.html @@ -7,7 +7,7 @@ {#  About Photo Assistant #}  Photo Assistant - About
- Built on: {{commits[0].date}} + {{build_info}}