Current section

15 Versions

Jump to

Compare versions

5 files changed
+9 additions
-14 deletions
  @@ -46,7 +46,12 @@ Prepend your env and app_name:
46 46 config :secret_config, env: "/#{Mix.env}/app_name"
47 47 ```
48 48
49 - SecretConfig supports dev environment. It will bypass the aws ssm call and read from a yaml file. It is important this file is created as follows `lib/fixtures/ssm_parameters.yml`. Also the env/app_name must match the above config (env/app_name):
49 + Set up the path to the local yml file (for test and dev)
50 + ```elixir
51 + config :secret_config, file: __DIR__ <> "/secret_config.yml"
52 + ```
53 +
54 + SecretConfig supports dev and test environments. It will bypass the aws ssm call and read from a yaml file. It is important this file is created as follows `/secret_config.yml`. Also the env/app_name must match the above config (env/app_name):
50 55 ```elixir
51 56 dev:
52 57 app_name:
  @@ -7,7 +7,6 @@
7 7 [<<"lib">>,<<"lib/secret_config">>,<<"lib/secret_config/cache">>,
8 8 <<"lib/secret_config/cache/server.ex">>,
9 9 <<"lib/secret_config/application.ex">>,<<"lib/secret_config.ex">>,
10 - <<"lib/fixtures">>,<<"lib/fixtures/ssm_parameters.yml">>,
11 10 <<".formatter.exs">>,<<"mix.exs">>,<<"README.md">>]}.
12 11 {<<"licenses">>,[<<"MIT">>]}.
13 12 {<<"links">>,[{<<"github">>,<<"https://github.com/jgaviria/secret_config">>}]}.
  @@ -43,4 +42,4 @@
43 42 {<<"optional">>,false},
44 43 {<<"repository">>,<<"hexpm">>},
45 44 {<<"requirement">>,<<"~> 2.5">>}]]}.
46 - {<<"version">>,<<"0.9.0">>}.
45 + {<<"version">>,<<"0.10.0">>}.
  @@ -1,9 +0,0 @@
1 - dev:
2 - portfolio_monitor:
3 - cis:
4 - pgp_key: test_key
5 -
6 - test:
7 - portfolio_monitor:
8 - cis:
9 - pgp_key: test_key
  @@ -56,7 +56,7 @@ defmodule SecretConfig.Cache.Server do
56 56 end
57 57
58 58 defp local_ssm_map(path) do
59 - local_ssm = Path.join(File.cwd!(), "lib/fixtures/ssm_parameters.yml")
59 + local_ssm = Application.get_env(:secret_config, :file)
60 60
61 61 with {:ok, parameters} <- YamlElixir.read_from_file(local_ssm) do
62 62 key = String.split(path, "/", trim: true)
  @@ -4,7 +4,7 @@ defmodule SecretConfig.MixProject do
4 4 def project do
5 5 [
6 6 app: :secret_config,
7 - version: "0.9.0",
7 + version: "0.10.0",
8 8 elixir: "~> 1.9",
9 9 start_permanent: Mix.env() == :prod,
10 10 package: package(),