diff --git a/mix.exs b/mix.exs index 134dd7d4..394f485a 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Philomena.MixProject do def project do [ app: :philomena, - version: System.get_env("PHILOMENA_VERSION") || "0.1.0", + version: "0.1.0", elixir: "~> 1.5", elixirc_paths: elixirc_paths(Mix.env()), compilers: [:phoenix, :gettext] ++ Mix.compilers(), diff --git a/post-receive b/post-receive index 55bb3b14..2c0e1862 100755 --- a/post-receive +++ b/post-receive @@ -34,10 +34,14 @@ if git diff --name-only $oldrev $newrev | grep "^assets/"; then mix phx.digest || die "assets compile failed" fi -# Generate release name to always be the current timestamp so that -# it will be considered an upgrade -export PHILOMENA_VERSION="0.1.$(date +%s)" +# TODO: fix this when I can figure out how to avoid recompiling +# the entire project when the version changes +# +# # Generate release name to always be the current timestamp so that +# # it will be considered an upgrade +# export PHILOMENA_VERSION="0.1.$(date +%s)" -mix distillery.release --upgrade || die "failed to generate release" +echo "Building release" +mix distillery.release --quiet || die "failed to generate release" -_build/prod/rel/philomena/bin/philomena upgrade $PHILOMENA_VERSION || die "failed to upgrade app; log in to the server and restart the app manually" \ No newline at end of file +_build/prod/rel/philomena/bin/philomena reboot || die "failed to upgrade app; log in to the server and restart the app manually" \ No newline at end of file diff --git a/rel/config.exs b/rel/config.exs index cfe61672..819bf4a3 100644 --- a/rel/config.exs +++ b/rel/config.exs @@ -50,7 +50,7 @@ end # will be used by default release :philomena do - set version: System.get_env("PHILOMENA_VERSION") + set version: current_version(:philomena) set applications: [ :runtime_tools, philomena: :permanent