Merge pull request #1471 from poanetwork/configure-version-in-config

fix: configure BLOCKSCOUT_VERSION in a standard way
pull/1504/head
Andrew Cravenho 6 years ago committed by GitHub
commit 51b2bf2b28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      apps/block_scout_web/config/config.exs
  2. 9
      apps/block_scout_web/lib/block_scout_web.ex

@ -8,7 +8,8 @@ use Mix.Config
# General application configuration # General application configuration
config :block_scout_web, config :block_scout_web,
namespace: BlockScoutWeb, namespace: BlockScoutWeb,
ecto_repos: [Explorer.Repo] ecto_repos: [Explorer.Repo],
version: System.get_env("BLOCKSCOUT_VERSION")
config :block_scout_web, BlockScoutWeb.Chain, config :block_scout_web, BlockScoutWeb.Chain,
network: System.get_env("NETWORK"), network: System.get_env("NETWORK"),

@ -16,14 +16,7 @@ defmodule BlockScoutWeb do
below. Instead, define any helper function in modules below. Instead, define any helper function in modules
and import those modules here. and import those modules here.
""" """
def version(), do: Application.get_env(:block_scout_web, :version)
# This is intentionally compiled in. Version is set
# at compile time, and we don't want to make a system
# env call to retreive it every time anyone loads any
# page.
@version System.get_env("BLOCKSCOUT_VERSION") || "unknown"
def version(), do: @version
def controller do def controller do
quote do quote do

Loading…
Cancel
Save