envied 0.10.0.alpha1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,64 +0,0 @@
1
- # -*- mode: ruby -*-¬
2
- # We allow defaults for local development (and local tests), but want our CI
3
- # to mimic our production as much as possible.
4
- # New developers that don't have RACK_ENV set, will in this way not be presented with a huge
5
- # list of missing variables, as defaults are still enabled.
6
- not_production_nor_ci = ->{ !(ENV['RACK_ENV'] == 'production' || ENV['CI']) }
7
- enable_defaults!(&not_production_nor_ci)
8
-
9
- # Your code will likely not use ENVied.RACK_ENV (better use Rails.env),
10
- # we want it to be present though; heck, we're using it in this file!
11
- variable :RACK_ENV
12
-
13
- variable :FORCE_SSL, :boolean, default: 'false'
14
- variable :PORT, :integer, default: '3000'
15
-
16
- variable :TAGS, :array, default: 'tag1,tag2'
17
- # ENVied.TAGS
18
- # => ['tag1', 'tag2']
19
-
20
- # generate the default value using the value of PORT:
21
- variable :PUBLIC_HOST_WITH_PORT, :string, default: proc { |envied|
22
- "localhost:#{envied.PORT}"
23
- }
24
-
25
- # Or better yet, use the URI type:
26
- variable :SITE_URI, :uri, default: 'http://localhost:5000/'
27
- # So with that you could now do:
28
- # ```
29
- # config.action_mailer.default_url_options = {
30
- # protocol: ENVied.SITE_URI.scheme,
31
- # host: ENVied.SITE_URI.host
32
- # }
33
- # config.action_mailer.asset_host = ENVied.SITE_URI.to_s
34
- # ```
35
-
36
- group :production do
37
- variable :MAIL_PAAS_USERNAME
38
- variable :DATABASE_URL
39
- end
40
-
41
- group :ci do
42
- # ci-only stuff
43
- end
44
-
45
- group :not_ci do
46
- # CI needs no puma-threads, and sidekiq-stuff etc.
47
- # Define that here:
48
- variable :MIN_THREADS, :integer, default: '1'
49
- # more...
50
- end
51
-
52
- # Depending on our situation, we can now require the correct groups in our initialization-file:
53
- # At local machines:
54
- # ENVied.require(:default, :development, :not_ci) or
55
- # ENVied.require(:default, :test, :not_ci)
56
-
57
- # At the server:
58
- # ENVied.require(:default, :production, :not_ci)
59
-
60
- # At CI:
61
- # ENVied.require(:default, :test, :ci)
62
-
63
- # All in one line:
64
- # ENVied.require(:default, ENV['RACK_ENV'], (ENV['CI'] ? :ci : :not_ci))
@@ -1,19 +0,0 @@
1
- class ENVied
2
- module EnvInterceptor
3
- def [](key)
4
- if @__envied_env_keys.include?(key)
5
- ENVied.public_send(key)
6
- else
7
- super
8
- end
9
- end
10
-
11
- def fetch(key, *args)
12
- if @__envied_env_keys.include?(key)
13
- ENVied.public_send(key)
14
- else
15
- super
16
- end
17
- end
18
- end
19
- end
@@ -1,10 +0,0 @@
1
- #
2
- # Allow ENV['FOO_<key_alias>'] to provide for ENVied.FOO (with ENV['FOO']
3
- # as fallback).
4
- # key_alias! { Rails.env }
5
-
6
- # variable :REDIS_URL, :string
7
- #
8
- # group :production do
9
- # variable :SECRET_KEY_BASE
10
- # end
@@ -1,9 +0,0 @@
1
- #!/bin/sh
2
-
3
- # Check the config of a Heroku app against the defined variables in `Envfile`
4
-
5
- <%- if @app %>
6
- HEROKU_APP=<%= @app %> exec heroku config --json | bundle exec envied check:heroku --groups <%= @groups.join(" ") %>
7
- <%- else %>
8
- exec heroku config --json | bundle exec envied check:heroku --groups <%= @groups.join(" ") %>
9
- <%- end %>