From 47fc09bacf6b61eb159d114d6db43a1c2ef6aee3 Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Fri, 27 May 2022 11:19:37 +0300 Subject: [PATCH] Add version file directly to priv --- .gitignore | 1 + assets/static/version.json | 1 - lib/plausible_web/controllers/api/external_controller.ex | 2 +- rel/prepare_release.sh | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 assets/static/version.json diff --git a/.gitignore b/.gitignore index a11241bba..874ac41c6 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 59c402996..000000000 --- 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 070d77630..543e644a5 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 924633730..77ee6a0ce 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