From 8c932f462c6cc63dc850aa59ea5e40e6e81c86d9 Mon Sep 17 00:00:00 2001 From: Omar Selo Date: Thu, 19 Sep 2024 15:40:58 +0300 Subject: [PATCH] Fix cache busting script --- frontend/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index ea4ec00c..128394b0 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -18,11 +18,11 @@ RUN flutter pub get RUN flutter pub run build_runner build --delete-conflicting-outputs RUN flutter build web --release # Cache busting so that users don't have to hard refresh -RUN RANDOMVALUE=$RANDOM -RUN mv build/web/flutter_bootstrap.js build/web/flutter_bootstrap.$RANDOMVALUE.js -RUN mv build/web/main.dart.js build/web/main.dart.$RANDOMVALUE.js -RUN find build/web/ -type f -exec sed -i -e 's/flutter_bootstrap.js/flutter_bootstrap.'$RANDOMVALUE'.js/g' {} \; -RUN find build/web/ -type f -exec sed -i -e 's/main.dart.js/main.dart.'$RANDOMVALUE'.js/g' {} \; +RUN RANDOMVALUE=$RANDOM && \ + mv build/web/flutter_bootstrap.js build/web/flutter_bootstrap.$RANDOMVALUE.js && \ + mv build/web/main.dart.js build/web/main.dart.$RANDOMVALUE.js && \ + find build/web/ -type f -exec sed -i -e 's/flutter_bootstrap.js/flutter_bootstrap.'$RANDOMVALUE'.js/g' {} \; && \ + find build/web/ -type f -exec sed -i -e 's/main.dart.js/main.dart.'$RANDOMVALUE'.js/g' {} \; FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive