Fix version population during prod build

This commit is contained in:
Jamil Bou Kheir
2021-11-15 17:07:10 -08:00
parent 67c63ea15b
commit 42776313f5
2 changed files with 8 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ dependency "postgresql"
dependency "nodejs"
dependency "elixir"
dependency "nftables" if linux?
dependency "ruby"
version("1.0.0") do
source path: File.expand_path("../", Omnibus::Config.project_root),
@@ -43,7 +44,10 @@ license :project_license
skip_transitive_dependency_licensing true
build do
env = with_standard_compiler_flags(with_embedded_path).merge("MIX_ENV" => "prod")
env = with_standard_compiler_flags(with_embedded_path).merge(
"MIX_ENV" => "prod",
"VERSION" => Omnibus::BuildVersion.semver
)
command "mix local.hex --force", env: env
command "mix local.rebar --force", env: env

View File

@@ -2,9 +2,11 @@
# frozen_string_literal: true
begin
# Development
require "omnibus"
rescue LoadError
print "0.0.0"
# Production
print ENV.fetch("VERSION", "0.0.0")
else
Omnibus::Config.append_timestamp false
print Omnibus::BuildVersion.semver