launchbox 0.0.3 → 0.0.4
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/lib/launchbox/config.rb +13 -2
- data/lib/launchbox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f1a60820062367d90b20ae1e00b722d116cbe2b
|
|
4
|
+
data.tar.gz: 4571173f4a20d9d231258df618e0047dd0a1c75c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f2b0e8af4e82a947c63754d03aebcb10c73607326515f942c26c6e9526f56ae92b829f6cfa942ca5f238279fb96bfbcef9b1a3674eac6090c31bc61315d9bf8f
|
|
7
|
+
data.tar.gz: 75557ae244acfc688691bfd4a10b5981609ed635c735cf8f46ce4b4c1762b01fdb54404b2edaf179dd04da0a52583ed426abb7f66c49d181e6fb924c45a8a319
|
data/lib/launchbox/config.rb
CHANGED
|
@@ -28,6 +28,16 @@ module Launchbox
|
|
|
28
28
|
# FIXME: LAUNCHBOX_APP_ID -- json[0] is hardcoding the first app.
|
|
29
29
|
app = json[0]
|
|
30
30
|
|
|
31
|
+
# gitignore config/application.yml so we aren't storing sensitive info in .git
|
|
32
|
+
# TODO: replace figaro with figaro-launchbox and application.yml with launchbox.yml
|
|
33
|
+
gitignore = Rails.root.join('.gitignore')
|
|
34
|
+
if File.readlines(gitignore).grep(/config\/application.yml/).size == 0
|
|
35
|
+
File.open(gitignore, 'a') do |file|
|
|
36
|
+
file.puts 'config/application.yml'
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# write config/application.yml to load env vars on startup
|
|
31
41
|
filename = Rails.root.join('config', 'application.yml')
|
|
32
42
|
|
|
33
43
|
# NOTE: 'w' overwrites the previous file!
|
|
@@ -37,9 +47,10 @@ module Launchbox
|
|
|
37
47
|
service['env_vars'].each do |key, value|
|
|
38
48
|
puts "setting environment variable #{key}"
|
|
39
49
|
|
|
40
|
-
# add for
|
|
50
|
+
# add new vars to application.yml for the restart
|
|
41
51
|
file.puts "#{key}: #{value}"
|
|
42
|
-
|
|
52
|
+
|
|
53
|
+
# add new vars to this instance
|
|
43
54
|
ENV[key] = value
|
|
44
55
|
end
|
|
45
56
|
end
|
data/lib/launchbox/version.rb
CHANGED