envied 0.10.0.alpha3 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +82 -176
- data/lib/envied/cli.rb +0 -9
- data/lib/envied/coercer/envied_string.rb +0 -4
- data/lib/envied/coercer.rb +1 -1
- data/lib/envied/configuration.rb +24 -16
- data/lib/envied/env_proxy.rb +9 -12
- data/lib/envied/variable.rb +11 -2
- data/lib/envied/version.rb +1 -1
- data/lib/envied.rb +6 -36
- metadata +21 -90
- data/.envrc.sample +0 -9
- data/.github/pull_request_template.md +0 -2
- data/.gitignore +0 -15
- data/.gitlab-ci.yml +0 -50
- data/.rspec +0 -3
- data/CHANGELOG.md +0 -208
- data/Gemfile +0 -4
- data/Rakefile +0 -6
- data/bin/bundle +0 -105
- data/bin/console +0 -10
- data/bin/envied +0 -5
- data/bin/rspec +0 -29
- data/bin/setup +0 -8
- data/envied.gemspec +0 -38
- data/examples/extensive_envfile +0 -64
- data/lib/envied/env_interceptor.rb +0 -19
- data/lib/envied/templates/Envfile.tt +0 -10
- data/lib/envied/templates/heroku-env-check.tt +0 -9
data/examples/extensive_envfile
DELETED
@@ -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!(¬_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,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 %>
|