Skip to content

Commit 10ec933

Browse files
committed
Store the environment variables needed for Slack with Envy on development
1 parent 5cb6252 commit 10ec933

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

.env.sample

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SLACK_CLIENT_ID=
2+
SLACK_CLIENT_SECRET=

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ npm-debug.log
1818
# this depending on your deployment strategy.
1919
/priv/static/
2020

21+
/*.env*[!.sample]
22+
2123
# Files matching config/*.secret.exs pattern contain sensitive
2224
# data and you should not commit them into version control.
2325
#
2426
# Alternatively, you may comment the line below and commit the
2527
# secrets files as long as you replace their contents by environment
2628
# variables.
27-
/config/*.secret.exs
29+
/config/*.secret.exs

lib/otto/application.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@ defmodule Otto.Application do
66
def start(_type, _args) do
77
import Supervisor.Spec
88

9+
unless Mix.env() == :prod do
10+
Envy.auto_load()
11+
Envy.reload_config()
12+
end
13+
914
# Define workers and child supervisors to be supervised
1015
children = [
1116
# Start the Ecto repository
1217
supervisor(Otto.Repo, []),
1318
# Start the endpoint when the application starts
14-
supervisor(OttoWeb.Endpoint, []),
19+
supervisor(OttoWeb.Endpoint, [])
1520
# Start your own worker by calling: Otto.Worker.start_link(arg1, arg2, arg3)
1621
# worker(Otto.Worker, [arg1, arg2, arg3]),
1722
]

mix.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ defmodule Otto.Mixfile do
3333
# Type `mix help deps` for examples and options.
3434
defp deps do
3535
[
36+
{:envy, "~> 1.1.1"},
3637
{:oauth2, "~> 0.8", override: true},
3738
{:phoenix, "~> 1.3.4"},
3839
{:phoenix_pubsub, "~> 1.0"},

mix.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"db_connection": {:hex, :db_connection, "1.1.3", "89b30ca1ef0a3b469b1c779579590688561d586694a3ce8792985d4d7e575a61", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: true]}], "hexpm"},
77
"decimal": {:hex, :decimal, "1.5.0", "b0433a36d0e2430e3d50291b1c65f53c37d56f83665b43d79963684865beab68", [:mix], [], "hexpm"},
88
"ecto": {:hex, :ecto, "2.2.10", "e7366dc82f48f8dd78fcbf3ab50985ceeb11cb3dc93435147c6e13f2cda0992e", [:mix], [{:db_connection, "~> 1.1", [hex: :db_connection, repo: "hexpm", optional: true]}, {:decimal, "~> 1.2", [hex: :decimal, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.8.0", [hex: :mariaex, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.13.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: true]}], "hexpm"},
9+
"envy": {:hex, :envy, "1.1.1", "0bc9bd654dec24fcdf203f7c5aa1b8f30620f12cfb28c589d5e9c38fe1b07475", [:mix], [], "hexpm"},
910
"file_system": {:hex, :file_system, "0.2.6", "fd4dc3af89b9ab1dc8ccbcc214a0e60c41f34be251d9307920748a14bf41f1d3", [:mix], [], "hexpm"},
1011
"gettext": {:hex, :gettext, "0.16.0", "4a7e90408cef5f1bf57c5a39e2db8c372a906031cc9b1466e963101cb927dafc", [:mix], [], "hexpm"},
1112
"hackney": {:hex, :hackney, "1.9.0", "51c506afc0a365868469dcfc79a9d0b94d896ec741cfd5bd338f49a5ec515bfe", [:rebar3], [{:certifi, "2.0.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "5.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"},

0 commit comments

Comments
 (0)