Browse Source

set up elixir releases

pull/26/head
Inhji Y. 2 years ago
parent
commit
2a2e17ec3c
  1. 11
      build.sh
  2. 4
      config/prod.exs
  3. 4
      config/releases.exs
  4. 13
      mix.exs

11
build.sh

@ -0,0 +1,11 @@
#!/usr/bin/env bash
mix deps.get --only prod
MIX_ENV=prod mix compile
npm install --prefix ./apps/tomie_web/assets
npm run deploy --prefix ./apps/tomie_web/assets
mix phx.digest
rm -rf "_build"
MIX_ENV=prod mix release

4
config/prod.exs

@ -10,7 +10,7 @@ use Mix.Config
# which you should run after static files are built and
# before starting your production server.
config :tomie_web, TomieWeb.Endpoint,
url: [host: "example.com", port: 80],
url: [host: System.get_env("HOSTNAME") || "localhost", port: 80],
cache_static_manifest: "priv/static/cache_manifest.json"
# ## SSL Support
@ -52,4 +52,4 @@ config :logger, level: :info
# Finally import the config/prod.secret.exs which loads secrets
# and configuration from environment variables.
import_config "prod.secret.exs"
# import_config "prod.secret.exs"

4
config/prod.secret.exs → config/releases.exs

@ -2,7 +2,7 @@
# from environment variables. You can also hardcode secrets,
# although such is generally not recommended and you have to
# remember to add this file to your .gitignore.
use Mix.Config
import Config
database_url =
System.get_env("DATABASE_URL") ||
@ -39,3 +39,5 @@ config :tomie_web, TomieWeb.Endpoint,
#
# Then you can assemble a release by calling `mix release`.
# See `mix help release` for more information.
config :tomie_web, TomieWeb.Endpoint, server: true

13
mix.exs

@ -4,6 +4,7 @@ defmodule Tomie.Umbrella.MixProject do
def project do
[
apps_path: "apps",
version: "0.1.0",
start_permanent: Mix.env() == :prod,
deps: deps(),
test_coverage: [tool: ExCoveralls],
@ -12,6 +13,18 @@ defmodule Tomie.Umbrella.MixProject do
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
releases: [
tomie: [
applications: [
tomie: :permanent,
tomie_web: :permanent,
db: :permanent,
bookmarks: :permanent,
scraper: :permanent,
tags: :permanent
]
]
]
]
end