env_json 0.2.2 → 0.3.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.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/env_json/rails_tasks.rb +6 -1
- data/lib/env_json/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c8ae56d36f3c3369dbc62ea9da4c1c9a4928e20
|
4
|
+
data.tar.gz: cd6644b61fb246c79c995506c398a301a6dd966c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44ca45e0312db4d12c4a1655b3348e4601499bd1647640f69575e9a6475ccc03c9d9f25129a1fe644e60e781b7e8649232f3a06e78e4a5a7358117f35900f1bb
|
7
|
+
data.tar.gz: c11546087ee1ee4b1ecd47f0e0ef0af490b73ad4f63bda17dfc987b535632aa953dea2c9bd86dec372ac64ab885d4ad6a27852059bb2c77540f08667e412c8e9
|
data/README.md
CHANGED
@@ -52,6 +52,12 @@ RAILS_ENV=production bundle exec rake env_json:eb
|
|
52
52
|
|
53
53
|
You should pass RAILS_ENV. EnvJson can't figure out which environment you're targeting alone.
|
54
54
|
|
55
|
+
You can pass ENVIRONMENT_NAME to give AWS ElasticBeanstalk environment name
|
56
|
+
|
57
|
+
```
|
58
|
+
RAILS_ENV=production ENVIRONMENT_NAME=my-staging-env bundle exec rake env_json:eb
|
59
|
+
```
|
60
|
+
|
55
61
|
## Development
|
56
62
|
|
57
63
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/env_json/rails_tasks.rb
CHANGED
@@ -9,11 +9,16 @@ namespace :env_json do
|
|
9
9
|
|
10
10
|
desc 'load env into ElasticBeanstalk'
|
11
11
|
task :eb do
|
12
|
+
eb_environment_name = ENV['ENVIRONMENT_NAME']
|
13
|
+
|
12
14
|
EnvJson.load_env_from_source_with_overrides(Rails.root.join('config/env.json'), ENV.fetch('RAILS_ENV'))
|
13
15
|
|
14
16
|
eb_formated_env = EnvJson.env.map{|key,value| "#{Shellwords.escape key}=#{Shellwords.escape value}" }.join(' ')
|
17
|
+
eb_environment_name_switch = eb_environment_name ? "-e #{eb_environment_name}" : nil
|
18
|
+
eb_command = "eb setenv #{eb_environment_name_switch} -v #{eb_formated_env}"
|
19
|
+
|
15
20
|
begin
|
16
|
-
PTY.spawn(
|
21
|
+
PTY.spawn(eb_command) do |stdin, stdout, pid|
|
17
22
|
begin
|
18
23
|
stdin.each { |line| print line }
|
19
24
|
rescue Errno::EIO
|
data/lib/env_json/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: env_json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Hellot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|