Add version file directly to priv

This commit is contained in:
Uku Taht 2022-05-27 11:19:37 +03:00
parent d23f7d5358
commit 47fc09bacf
4 changed files with 4 additions and 4 deletions

1
.gitignore vendored
View File

@ -36,6 +36,7 @@ npm-debug.log
# we ignore priv/static. You may want to comment # we ignore priv/static. You may want to comment
# this depending on your deployment strategy. # this depending on your deployment strategy.
/priv/static/ /priv/static/
/priv/version.json
# Files matching config/*.secret.exs pattern contain sensitive # Files matching config/*.secret.exs pattern contain sensitive
# data and you should not commit them into version control. # data and you should not commit them into version control.

View File

@ -1 +0,0 @@
{"version": "v1.5.0", "commit": "db27aa48bb49ca49659ec529a26398a73b7b083f"}

View File

@ -56,7 +56,7 @@ defmodule PlausibleWeb.Api.ExternalController do
end end
def info(conn, _params) do 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 = version =
with {:ok, file} <- File.read(version_file), with {:ok, file} <- File.read(version_file),

View File

@ -10,9 +10,9 @@ fi
if [ "$GITHUB_WORKSPACE" != "" ] if [ "$GITHUB_WORKSPACE" != "" ]
then then
TARGET_FOLDER=$GITHUB_WORKSPACE/assets/static TARGET_FOLDER=$GITHUB_WORKSPACE/priv
else else
TARGET_FOLDER=$(pwd)/assets/static TARGET_FOLDER=$(pwd)/priv
fi fi
echo "{\"version\": \"$VERSION\", \"commit\": \"$COMMIT\"}" > $TARGET_FOLDER/version.json echo "{\"version\": \"$VERSION\", \"commit\": \"$COMMIT\"}" > $TARGET_FOLDER/version.json