add footer, include version
authorTom Powell <tom@powell.io>
Sun, 2 Dec 2018 02:52:17 +0000 (18:52 -0800)
committerTom Powell <tom@powell.io>
Sun, 2 Dec 2018 02:52:17 +0000 (18:52 -0800)
.gitlab-ci.yml
Dockerfile
ui/app.py
ui/static/custom.css
ui/templates/builds.html
ui/templates/footer.html [new file with mode: 0644]
ui/templates/runner.html
ui/templates/runners.html
ui/templates/stats.html

index 629ad593d02b7f3796ff4502df6c47c18f03981b..cf995fe476c5b55e99a495a2fce85bc5b5053221 100644 (file)
@@ -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
index 356ec7811f7d859ed693fa36875e995e4e6523f1..75732e6cb2c0745c36a032110c5f7d02f3d771e0 100644 (file)
@@ -1,5 +1,9 @@
 FROM python:3.6
 
+ARG VERSION=dev
+
+ENV VERSION=$VERSION
+
 COPY . /app
 WORKDIR /app
 RUN pip install gunicorn
index 85aa8c34b651faae448f1b71298bc2bdde93aa8a..60b450baabfa07d200c27d155b8eb62d63c9fbb5 100644 (file)
--- 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:
index e7d61dfbacebaac3e4b7d1de3bd69dd260bffaae..6f32445f28c16c45015922e394ab9250c15d12fa 100644 (file)
@@ -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
index a7e8bda795c06d35144c41f0fe95f5fc3c03cfc8..39d738f1a20186ab3e1f3f7d635f2c00b67ab150 100644 (file)
@@ -31,4 +31,5 @@
         </table>
         {{render_pagination(builds)}}
     </div>
+{% include "footer.html" %}
 {% endblock %}
diff --git a/ui/templates/footer.html b/ui/templates/footer.html
new file mode 100644 (file)
index 0000000..222a108
--- /dev/null
@@ -0,0 +1,6 @@
+{% block footer %}
+<footer class="footer">
+  <span>© 2017-2018 LineageOS. Licensed under Apache 2.0.</span>
+  <span><a href="https://gitlab.com/lineageos/infra/builds-ui">Source</a> (version: {{version()}})</span>
+</footer>
+{% endblock %}
\ No newline at end of file
index 48899d410ce87feaf210cb3fa332e432f5f9d7bb..e0dc954d1f0e854f65046de4fc116440a8d7ea33 100644 (file)
@@ -35,4 +35,5 @@
         </table>
         {{render_pagination(builds)}}
     </div>
+{% include "footer.html" %}
 {% endblock %}
index 8de77eb7d132df9858b757280c05382df360144f..262d2015de5ab0c23fb9928d997c1843e0f2110b 100644 (file)
@@ -17,4 +17,5 @@
             {% endfor %}
         </table>
     </div>
+{% include "footer.html" %}
 {% endblock %}
index 8e121f06cecedaf076501b1daeb33b08f805255f..d9a873c07bfce88d001e43b6f645098bd3506729 100644 (file)
@@ -54,4 +54,5 @@
     {% endfor %}
 
     </div>
+{% include "footer.html" %}
 {% endblock %}