aris-control 3.0.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aris-control/bookkeeper.rb +7 -9
- data/lib/aris-control/thor.rb +8 -4
- data/lib/aris-control/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: 47f5a4b25d09aa4971c478f813b664ed6b32ced1
|
4
|
+
data.tar.gz: 53e740ce9a4947fdffe9233c5749ef6c7e75caac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdb0f2f7749ffe4b374c160269b0e39696053d69fc3207ec0d5d27f5a754145cf3f4915e1d20486c3ede1855fb4408e0dd5fc307956e8b5fcf1427c504e2b1c7
|
7
|
+
data.tar.gz: ede15203756193ac6eb025d112528bb3c21f2b6e98a1a9ff9675463148a280e9a187009d1c9439affce9ca0dd90a3262b1965c699abc645e1e34362c385e1195
|
@@ -14,17 +14,15 @@ module ArisControl
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def add(name, opts = {})
|
17
|
-
app = apps[name] || {}
|
18
|
-
ssh_key = opts[:ssh_key]
|
19
17
|
env_vars = opts[:env_vars]
|
20
|
-
|
21
|
-
|
22
|
-
h['email']
|
23
|
-
h['ssh_key']
|
24
|
-
h['
|
18
|
+
app = apps[name] || {}
|
19
|
+
apps[name] = app.dup.tap do |h|
|
20
|
+
h['email'] = opts[:email] || app.fetch('email')
|
21
|
+
h['ssh_key'] = opts[:ssh_key] if opts[:ssh_key]
|
22
|
+
h['pg_role'] = opts[:pg_role] if opts[:pg_role]
|
23
|
+
h['pg_pass'] = opts[:pg_pass] if opts[:pg_pass]
|
24
|
+
h['env_vars'] = with_upcased_keys(env_vars) if env_vars
|
25
25
|
end
|
26
|
-
|
27
|
-
apps[name] = app.merge(_opts)
|
28
26
|
persistence.store_apps(apps)
|
29
27
|
end
|
30
28
|
|
data/lib/aris-control/thor.rb
CHANGED
@@ -5,12 +5,16 @@ class ArisControl::Thor < Thor
|
|
5
5
|
desc 'add/update appname', 'Adds/Updates an aris app.'
|
6
6
|
method_option :email, type: :string, desc: 'The apps email address. Used for web login.'
|
7
7
|
method_option :ssh_key, type: :string, desc: 'The apps ssh public key. Used for git access via ssh.'
|
8
|
+
method_option :pg_role, type: :string, desc: 'The apps postgres role.'
|
9
|
+
method_option :pg_pass, type: :string, desc: 'The apps postgres password.'
|
8
10
|
method_option :env_vars, type: :hash, desc: 'The apps app env vars. Env vars will be accessible inside the app via ENV[VAR-NAME].'
|
9
11
|
def add(name)
|
10
|
-
opts = Hash.new.tap do |
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
opts = Hash.new.tap do |o|
|
13
|
+
o[:email] = options[:email]
|
14
|
+
o[:ssh_key] = options[:ssh_key] if options[:ssh_key]
|
15
|
+
o[:pg_role] = options[:pg_role] if options[:pg_role]
|
16
|
+
o[:pg_pass] = options[:pg_pass] if options[:pg_pass]
|
17
|
+
o[:env_vars] = options[:env_vars] if options[:env_vars]
|
14
18
|
end
|
15
19
|
bookkeeper.add(name, **opts)
|
16
20
|
puts "Added/Updated app: #{name}, #{opts}"
|
data/lib/aris-control/version.rb
CHANGED