Browse Source

set up elixir releases

tags/v0.1.1
Inhji Y. 6 months ago
parent
commit
2a2e17ec3c
4 changed files with 29 additions and 3 deletions
  1. +11
    -0
      build.sh
  2. +2
    -2
      config/prod.exs
  3. +3
    -1
      config/releases.exs
  4. +13
    -0
      mix.exs

+ 11
- 0
build.sh View File

@@ -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

+ 2
- 2
config/prod.exs View File

@@ -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"

config/prod.secret.exs → config/releases.exs View File

@@ -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
- 0
mix.exs View File

@@ -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


Loading…
Cancel
Save