Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Add version file directly to priv

Uku Taht47fc09bacf6b
diff --git a/.gitignore b/.gitignore
index a11241bbab..874ac41c67 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,7 @@ npm-debug.log
# we ignore priv/static. You may want to comment
# this depending on your deployment strategy.
/priv/static/
+/priv/version.json
# Files matching config/*.secret.exs pattern contain sensitive
# data and you should not commit them into version control.
diff --git a/assets/static/version.json b/assets/static/version.json
deleted file mode 100644
index 59c4029967..0000000000
--- a/assets/static/version.json
+++ /dev/null
@@ -1 +0,0 @@
-{"version": "v1.5.0", "commit": "db27aa48bb49ca49659ec529a26398a73b7b083f"}
diff --git a/lib/plausible_web/controllers/api/external_controller.ex b/lib/plausible_web/controllers/api/external_controller.ex
index 070d776307..543e644a57 100644
--- a/lib/plausible_web/controllers/api/external_controller.ex
+++ b/lib/plausible_web/controllers/api/external_controller.ex
@@ -56,7 +56,7 @@ defmodule PlausibleWeb.Api.ExternalController do
end
def info(conn, _params) do
- version_file = Application.app_dir(:plausible, "priv/static/version.json")
+ version_file = Application.app_dir(:plausible, "priv/version.json")
version =
with {:ok, file} <- File.read(version_file),
diff --git a/rel/prepare_release.sh b/rel/prepare_release.sh
index 924633730c..77ee6a0cee 100755
--- a/rel/prepare_release.sh
+++ b/rel/prepare_release.sh
@@ -10,9 +10,9 @@ fi
if [ "$GITHUB_WORKSPACE" != "" ]
then
- TARGET_FOLDER=$GITHUB_WORKSPACE/assets/static
+ TARGET_FOLDER=$GITHUB_WORKSPACE/priv
else
- TARGET_FOLDER=$(pwd)/assets/static
+ TARGET_FOLDER=$(pwd)/priv
fi
echo "{\"version\": \"$VERSION\", \"commit\": \"$COMMIT\"}" > $TARGET_FOLDER/version.json