Browse Source

break browser cache on new version

tags/0.13.1
Henning Jacobs 1 week ago
parent
commit
4412e77bfe
2 changed files with 11 additions and 7 deletions
  1. 5
    1
      Dockerfile
  2. 6
    6
      kube_web/templates/base.html

+ 5
- 1
Dockerfile View File

@@ -25,6 +25,10 @@ COPY --from=0 /usr/local/lib/python3.7/site-packages /usr/local/lib/python3.7/si
COPY kube_web /kube_web

ARG VERSION=dev
RUN sed -i "s/__version__ = .*/__version__ = '${VERSION}'/" /kube_web/__init__.py

# replace build version in package and
# add build version to static asset links to break browser cache
RUN sed -i "s/__version__ = .*/__version__ = '${VERSION}'/" /kube_web/__init__.py && \
sed -i "s/BUILD_VERSION/${VERSION}/g" /kube_web/templates/base.html

ENTRYPOINT ["/usr/local/bin/python", "-m", "kube_web"]

+ 6
- 6
kube_web/templates/base.html View File

@@ -4,12 +4,12 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{% endblock %} - Kubernetes Web View</title>
<link rel="stylesheet" href="/assets/bulma.min.css">
<script defer src="/assets/solid.min.js"></script>
<script defer src="/assets/fontawesome.min.js"></script>
<script src="/assets/kube-web.js"></script>
<script src="/assets/anchor.min.js"></script>
<link rel="stylesheet" href="/assets/kube-web.css" />
<link rel="stylesheet" href="/assets/bulma.min.css?v=BUILD_VERSION">
<script defer src="/assets/solid.min.js?v=BUILD_VERSION"></script>
<script defer src="/assets/fontawesome.min.js?v=BUILD_VERSION"></script>
<script src="/assets/kube-web.js?v=BUILD_VERSION"></script>
<script src="/assets/anchor.min.js?v=BUILD_VERSION"></script>
<link rel="stylesheet" href="/assets/kube-web.css?v=BUILD_VERSION" />
<link rel="shortcut icon" href="/assets/favicon.png">
<link rel="icon" type="image/png" href="/assets/favicon.png">
{% include "partials/extrahead.html" %}

Loading…
Cancel
Save