diff --git a/.drone.yml b/.drone.yml index 80e7fe9..30d4ce2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,6 +12,10 @@ trigger: - pull_request steps: +- name: commit hash magic + image: bitnami/git:2.33.0 + commands: + - git show -s --format=%h > hash - name: kaniko image: plugins/kaniko settings: diff --git a/.gitignore b/.gitignore index 3562f45..686fc35 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode/ dist/ +hash \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 3c2d800..dcf2aa0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ RUN pip install pipenv && pipenv install --system COPY app.py /app/app.py COPY templates/ /app/templates COPY data/ /app/data +COPY hash /app/hash RUN python ./app.py diff --git a/app.py b/app.py index ad599a2..aebc1f3 100644 --- a/app.py +++ b/app.py @@ -26,11 +26,16 @@ update = date.today() tijden = render("tijden.md") nieuws = render("nieuws.md") +def read_hash(): + with open("hash") as f: + line = f.readline() + return {"long": line, "short": line[0:7]} inject_now = {'now': date.today().year, 'tijden': tijden, 'nieuws': nieuws, - 'update': update} + 'update': update, + 'hash': read_hash()} diff --git a/templates/sidebar.html b/templates/sidebar.html index 857f8a9..2a74f12 100644 --- a/templates/sidebar.html +++ b/templates/sidebar.html @@ -54,6 +54,7 @@

Laatste update: {{ update }}
+ Build {{hash.short}}
Webmaster: Julius de Jeu