Skip to content

Commit

Permalink
hello world gigalixir
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyMBrown committed Jun 7, 2019
1 parent 527d19f commit 876bae6
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .buildpacks
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
https://github.com/gigalixir/gigalixir-buildpack-clean-cache.git
https://github.com/HashNuke/heroku-buildpack-elixir
https://github.com/gjaldon/heroku-buildpack-phoenix-static
https://github.com/gigalixir/gigalixir-buildpack-distillery.git
13 changes: 11 additions & 2 deletions config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ use Mix.Config
config :habitica_backend, HabiticaBackendWeb.Endpoint,
http: [:inet6, port: System.get_env("PORT") || 4000],
url: [host: "example.com", port: 80],
cache_static_manifest: "priv/static/cache_manifest.json"
cache_static_manifest: "priv/static/cache_manifest.json",
server: true,
secret_key_base: "${SECRET_KEY_BASE}"

config :havitica_backend, HabiticaBackend.Repo,
adapter: Ecto.Adapters.Postgres,
url: "${DATABASE_URL}",
database: "",
ssl: true,
pool_size: 1

# Do not print debug messages in production
config :logger, level: :info
Expand Down Expand Up @@ -68,4 +77,4 @@ config :logger, level: :info

# Finally import the config/prod.secret.exs which should be versioned
# separately.
import_config "prod.secret.exs"
#import_config "prod.secret.exs"
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ defmodule HabiticaBackend.MixProject do
{:plug_cowboy, "~> 2.0"},
{:bcrypt_elixir, "~> 2.0"},
{:corsica, "~> 1.0"},
{:ex_machina, "~> 2.3", only: :test}
{:ex_machina, "~> 2.3", only: :test},
{:distillery, "~> 2.0", runtime: false}
]
end

Expand Down
2 changes: 2 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
%{
"artificery": {:hex, :artificery, "0.4.2", "3ded6e29e13113af52811c72f414d1e88f711410cac1b619ab3a2666bbd7efd4", [:mix], [], "hexpm"},
"bcrypt_elixir": {:hex, :bcrypt_elixir, "2.0.3", "64e0792d5b5064391927bf3b8e436994cafd18ca2d2b76dea5c76e0adcf66b7c", [:make, :mix], [{:comeonin, "~> 5.1", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.4", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm"},
"comeonin": {:hex, :comeonin, "5.1.2", "fbbbbbfcf0f0e9900c0336d16c8d462edf838ba1759577e29cc5fbd7c28a4540", [:mix], [], "hexpm"},
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"},
Expand All @@ -7,6 +8,7 @@
"cowlib": {:hex, :cowlib, "2.7.3", "a7ffcd0917e6d50b4d5fb28e9e2085a0ceb3c97dea310505f7460ff5ed764ce9", [:rebar3], [], "hexpm"},
"db_connection": {:hex, :db_connection, "2.0.6", "bde2f85d047969c5b5800cb8f4b3ed6316c8cb11487afedac4aa5f93fd39abfa", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"},
"decimal": {:hex, :decimal, "1.7.0", "30d6b52c88541f9a66637359ddf85016df9eb266170d53105f02e4a67e00c5aa", [:mix], [], "hexpm"},
"distillery": {:hex, :distillery, "2.0.14", "25fc1cdad06282334dbf4a11b6e869cc002855c4e11825157498491df2eed594", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm"},
"ecto": {:hex, :ecto, "3.1.3", "b3c2ef40b742fa76e2cc1c2fa46965e445d1ea8fd92330d64e0ae84114f53bcf", [:mix], [{:decimal, "~> 1.6", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"},
"ecto_sql": {:hex, :ecto_sql, "3.1.1", "af2458e7a467d75a6389e1d4ebfb57c328ccc684d6ee52145f7b34e94efb5fc4", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.1.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.9.1", [hex: :mariaex, repo: "hexpm", optional: true]}, {:myxql, "~> 0.2.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.14.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"},
"elixir_make": {:hex, :elixir_make, "0.5.2", "96a28c79f5b8d34879cd95ebc04d2a0d678cfbbd3e74c43cb63a76adf0ee8054", [:mix], [], "hexpm"},
Expand Down
55 changes: 55 additions & 0 deletions rel/config.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Import all plugins from `rel/plugins`
# They can then be used by adding `plugin MyPlugin` to
# either an environment, or release definition, where
# `MyPlugin` is the name of the plugin module.
~w(rel plugins *.exs)
|> Path.join()
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))

use Mix.Releases.Config,
# This sets the default release built by `mix release`
default_release: :default,
# This sets the default environment used by `mix release`
default_environment: Mix.env()

# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/config/distillery.html


# You may define one or more environments in this file,
# an environment's settings will override those of a release
# when building in that environment, this combination of release
# and environment configuration is called a profile

environment :dev do
# If you are running Phoenix, you should make sure that
# server: true is set and the code reloader is disabled,
# even in dev mode.
# It is recommended that you build with MIX_ENV=prod and pass
# the --env flag to Distillery explicitly if you want to use
# dev mode.
set dev_mode: true
set include_erts: false
set cookie: :"E`}erI|?<!tpLb^R[J&|^(cB~.dDrIr=:<hcO80[T22LmPmGWD2spJBqOTQ6cM}L"
end

environment :prod do
set include_erts: true
set include_src: false
set cookie: :"fyWh/l@l:flcWGgZ`!1MKmMqh5Z=wfMyJS4WHDdnA`9SQSKf>?lBew9z%$VwI>yt"
set vm_args: "rel/vm.args"
end

# You may define one or more releases in this file.
# If you have not set a default release, or selected one
# when running `mix release`, the first release in the file
# will be used by default

release :habitica_backend do
set version: current_version(:habitica_backend)
set applications: [
:runtime_tools
]
end

3 changes: 3 additions & 0 deletions rel/plugins/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.*
!*.exs
!.gitignore
30 changes: 30 additions & 0 deletions rel/vm.args
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## This file provide the arguments provided to the VM at startup
## You can find a full list of flags and their behaviours at
## http://erlang.org/doc/man/erl.html

## Name of the node
-name <%= release_name %>@127.0.0.1

## Cookie for distributed erlang
-setcookie <%= release.profile.cookie %>

## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive
## (Disabled by default..use with caution!)
##-heart

## Enable kernel poll and a few async threads
##+K true
##+A 5
## For OTP21+, the +A flag is not used anymore,
## +SDio replace it to use dirty schedulers
##+SDio 5

## Increase number of concurrent ports/sockets
##-env ERL_MAX_PORTS 4096

## Tweak GC to run more often
##-env ERL_FULLSWEEP_AFTER 10

# Enable SMP automatically based on availability
# On OTP21+, this is not needed anymore.
-smp auto

0 comments on commit 876bae6

Please sign in to comment.