From de2bd7f5f3c43284021cfcd9b8fdb7368441b366 Mon Sep 17 00:00:00 2001 From: Tom Powell Date: Sat, 1 Dec 2018 18:52:17 -0800 Subject: [PATCH] add footer, include version --- .gitlab-ci.yml | 2 +- Dockerfile | 4 ++++ ui/app.py | 5 +++++ ui/static/custom.css | 17 +++++++++++++++++ ui/templates/builds.html | 1 + ui/templates/footer.html | 6 ++++++ ui/templates/runner.html | 1 + ui/templates/runners.html | 1 + ui/templates/stats.html | 1 + 9 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 ui/templates/footer.html diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 629ad59..cf995fe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ build: DOCKER_DRIVER: overlay2 script: - docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD - - docker build . -t $CI_REGISTRY_IMAGE:$CI_PIPELINE_IID + - docker build --build-arg VERSION=$CI_COMMIT_SHA . -t $CI_REGISTRY_IMAGE:$CI_PIPELINE_IID - docker tag $CI_REGISTRY_IMAGE:$CI_PIPELINE_IID $CI_REGISTRY_IMAGE:latest - docker push $CI_REGISTRY_IMAGE:latest - docker push $CI_REGISTRY_IMAGE:$CI_PIPELINE_IID diff --git a/Dockerfile b/Dockerfile index 356ec78..75732e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,9 @@ FROM python:3.6 +ARG VERSION=dev + +ENV VERSION=$VERSION + COPY . /app WORKDIR /app RUN pip install gunicorn diff --git a/ui/app.py b/ui/app.py index 85aa8c3..60b450b 100644 --- a/ui/app.py +++ b/ui/app.py @@ -31,6 +31,11 @@ nav.register_element('top', Navbar( headers = {'Private-Token': os.environ.get('GITLAB_TOKEN', '')} +def version(): + return os.environ.get("VERSION", "dev")[:6] + +app.jinja_env.globals.update(version=version) + def parse_args(): args = {} if request.args: diff --git a/ui/static/custom.css b/ui/static/custom.css index e7d61df..6f32445 100644 --- a/ui/static/custom.css +++ b/ui/static/custom.css @@ -27,3 +27,20 @@ a:focus, a:hover { .pagination li a, .pagination li a:focus, .pagination li a:hover { color: #167c80; } +.footer { + position: absolute; + bottom: 0; + width: 100%; + height: 60px; + line-height: 60px; + background-color: #167c80; + color: white; + display: flex; + justify-content: space-between; + width: 100%; + +} + +.footer a { + color: white; +} \ No newline at end of file diff --git a/ui/templates/builds.html b/ui/templates/builds.html index a7e8bda..39d738f 100644 --- a/ui/templates/builds.html +++ b/ui/templates/builds.html @@ -31,4 +31,5 @@ {{render_pagination(builds)}} +{% include "footer.html" %} {% endblock %} diff --git a/ui/templates/footer.html b/ui/templates/footer.html new file mode 100644 index 0000000..222a108 --- /dev/null +++ b/ui/templates/footer.html @@ -0,0 +1,6 @@ +{% block footer %} + +{% endblock %} \ No newline at end of file diff --git a/ui/templates/runner.html b/ui/templates/runner.html index 48899d4..e0dc954 100644 --- a/ui/templates/runner.html +++ b/ui/templates/runner.html @@ -35,4 +35,5 @@ {{render_pagination(builds)}} +{% include "footer.html" %} {% endblock %} diff --git a/ui/templates/runners.html b/ui/templates/runners.html index 8de77eb..262d201 100644 --- a/ui/templates/runners.html +++ b/ui/templates/runners.html @@ -17,4 +17,5 @@ {% endfor %} +{% include "footer.html" %} {% endblock %} diff --git a/ui/templates/stats.html b/ui/templates/stats.html index 8e121f0..d9a873c 100644 --- a/ui/templates/stats.html +++ b/ui/templates/stats.html @@ -54,4 +54,5 @@ {% endfor %} +{% include "footer.html" %} {% endblock %} -- 2.20.1