dokku_client 1.0 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77adf120b4406d0e502dc931bdc9feb2a52491d1
4
- data.tar.gz: 4b290479f297e51af9e1ee2d5afe0cb139343636
3
+ metadata.gz: 4c5f6013e00c4f5eaaffae4a99efa103db2f04e7
4
+ data.tar.gz: 13f0e85695c12f4ce8f5d70cf154d828f9ca3d5d
5
5
  SHA512:
6
- metadata.gz: 995043f21370163f484433b117d6e11e22f2423e45a938f478297af136ebe9da3ab9b9b6ffdacd30e049671f779a73b3b00fa313a28d90ba56f38bcfd1aa74cf
7
- data.tar.gz: f0cbed2205eb095fa869690dd41957b56959b08a0b864689b50abe9650603c2b42dc6d103933fa19ca6b362d29c620025c23c54856ca8f8e76b6948b2697b717
6
+ metadata.gz: 5a3a2d86104c06a2998b5d2935020c99c304c865007af4cf343e04a9c5389a52b3807f4ad3156f75b2f4e9a36fd494ebc7e1510f79c424d79899fc7054bbdfd0
7
+ data.tar.gz: c433a5fefc357d52da89f3c7e911d5ea84ec0058ac71b8095adf653a87b3d2f70c706fce37968b31ce91ec3e6db27d39599761bb8e07d9ac0d61a68d8321a0b7
data/CHANGELOG CHANGED
@@ -1,6 +1,11 @@
1
1
  === 1.1 Current release
2
2
 
3
- * **TODO** more commands (redis , mysql)
3
+ * **TODO** more commands (mysql)
4
+
5
+ === 1.1
6
+
7
+ * fix r, set config, unset config commands (no quotes needed)
8
+ * added redis commands
4
9
 
5
10
  === 1.0
6
11
 
data/README.md CHANGED
@@ -8,6 +8,14 @@
8
8
 
9
9
  DokkuClient ... This gem for now assumes that you have installed these plugins: (memcached, mongodb, mysql, postgresql, redis)
10
10
 
11
+ This gem is for people who don't want to type every time something like
12
+
13
+ $ ssh -t dokku@my_host.com command app_name command
14
+
15
+ but just do
16
+
17
+ $ dokku command
18
+
11
19
  ## Installation
12
20
 
13
21
  Install it yourself as:
@@ -24,14 +32,14 @@ You will be asked for your dokku host and project name which will be stored in y
24
32
 
25
33
  ## Customize list of available commands
26
34
 
27
- In 'active commands' question when you configuring dokku client type plugin name separated by comma and commands for this plugin will be visible in dokku help.
35
+ In 'active commands' question when you configuring dokku client type plugin name separated by comma and commands for this plugin will be visible in dokku help.
28
36
  Available plugins:
29
37
 
30
- + memcached
31
- + postgresl
32
- + mongodb
38
+ + memcached
39
+ + postgresl
40
+ + mongodb
33
41
 
34
- Common and Config commands are enabled by default. If you don't answer to 'active commands' then all commands will be visible.
42
+ Common and Config commands are enabled by default. If you don't answer to 'active commands' then all commands will be visible.
35
43
 
36
44
 
37
45
  ## Show help
@@ -84,6 +92,12 @@ or
84
92
  list_postgres <db> display list of postgresql containers
85
93
  logs_postgres display last logs from postgresql container
86
94
 
95
+ Redis commands:
96
+ create_redis create a redis container
97
+ delete_redis delete redis container
98
+ info_redis display container informations
99
+ link_redis <container> link an app to a redis container
100
+ logs_redis display last logs from redis container
87
101
 
88
102
  ## Contributing
89
103
 
@@ -19,5 +19,6 @@ Gem::Specification.new do |gem|
19
19
  gem.add_runtime_dependency "colorize"
20
20
 
21
21
  gem.add_development_dependency "rake"
22
+ gem.add_development_dependency "pry"
22
23
 
23
24
  end
@@ -51,10 +51,10 @@ module DokkuClient
51
51
  def_delegator :dokku_config, :set_variables, :set_config
52
52
  alias :sc :set_config
53
53
 
54
- def_delegator :dokku_config, :get_variables, :get_config
54
+ def_delegator :dokku_config, :get_variable, :get_config
55
55
  alias :gc :get_config
56
56
 
57
- def_delegator :dokku_config, :unset_config, :unset_config
57
+ def_delegator :dokku_config, :unset_variables, :unset_config
58
58
  alias :uc :unset_config
59
59
 
60
60
  ### memcached commands
@@ -103,6 +103,18 @@ module DokkuClient
103
103
 
104
104
  def_delegator :dokku_postgresql, :restore_postgresql, :restore_postgres
105
105
 
106
+ ### redis commands
107
+
108
+ def_delegator :dokku_redis, :create_redis, :create_redis
109
+
110
+ def_delegator :dokku_redis, :delete_redis, :delete_redis
111
+
112
+ def_delegator :dokku_redis, :info_redis, :info_redis
113
+
114
+ def_delegator :dokku_redis, :link_redis, :link_redis
115
+
116
+ def_delegator :dokku_redis, :logs_redis, :logs_redis
117
+
106
118
  def reconfig
107
119
  DokkuClient::Base.new.reconfig
108
120
  end
@@ -133,6 +145,10 @@ module DokkuClient
133
145
  @dokku_postgresql ||= DokkuClient::Plugins::Postgresql.new(@options)
134
146
  end
135
147
 
148
+ def dokku_redis
149
+ @dokku_redis ||= DokkuClient::Plugins::Redis.new(@options)
150
+ end
151
+
136
152
  def no_argument_error
137
153
  puts "You forgot argument - look into help"
138
154
  end
@@ -157,6 +173,7 @@ module DokkuClient
157
173
  dokku_memcached.commands(opts)
158
174
  dokku_mongodb.commands(opts)
159
175
  dokku_postgresql.commands(opts)
176
+ dokku_redis.commands(opts)
160
177
  opts.separator ""
161
178
  opts.separator "\nOptions"
162
179
 
@@ -183,12 +200,16 @@ module DokkuClient
183
200
  opt_parser.parse!(args)
184
201
 
185
202
  case args[0]
186
- when "set_config", "get_config", "unset_config", "sc", "gc", "uc", "link_mem", "r", "run_command", "create_postgres", "rc", "info_postgres", "delete_postgres", "logs_postgres", "link_postgres"
203
+ when "get_config", "gc", "link_mem", "create_postgres", "rc", "info_postgres", "delete_postgres", "logs_postgres", "link_postgres", "link_redis"
187
204
  self.send(args[0].to_sym, args[1])
188
205
  when "help"
189
206
  puts opt_parser
190
- when "logs", "reconfig", "config", "c", "l", "create_mem", "delete_mem", "info_mem", "logs_mem", "p", "url", "u", "list_postgres", "rdm"
207
+ when "logs", "reconfig", "config", "c", "l", "create_mem", "delete_mem", "info_mem", "logs_mem", "p", "url", "u", "list_postgres", "rdm", "create_redis", "delete_redis", "info_redis", "logs_redis"
191
208
  self.send(args[0].to_sym)
209
+ when "run_command", "r", "sc", "set_config", "unset_config", "uc"
210
+ first = args[0]
211
+ args.shift
212
+ self.send(first.to_sym, args.join(' '))
192
213
  when nil
193
214
  no_method_error
194
215
  puts opt_parser
@@ -2,6 +2,40 @@ module DokkuClient
2
2
  module Plugins
3
3
  class Redis < Base
4
4
 
5
+ def run
6
+ end
7
+
8
+ def create_redis
9
+ dokku "redis:create #{@options["project-name"]}"
10
+ end
11
+
12
+ def delete_redis
13
+ dokku "redis:delete #{@options["project-name"]}"
14
+ end
15
+
16
+ def info_redis
17
+ dokku "redis:info #{@options["project-name"]}"
18
+ end
19
+
20
+ def link_redis container
21
+ dokku "redis:link #{@options["project-name"]} container"
22
+ end
23
+
24
+ def logs_redis
25
+ dokku "redis:logs #{@options["project-name"]}"
26
+ end
27
+
28
+ def commands opts
29
+ if plugin_enabled('redis')
30
+ opts.separator "\n Redis commands:"
31
+ opts.separator " create_redis create a redis container"
32
+ opts.separator " delete_redis delete redis container"
33
+ opts.separator " info_redis display container informations"
34
+ opts.separator " link_redis <container> link an app to a redis container"
35
+ opts.separator " logs_redis display last logs from redis container"
36
+ end
37
+ end
38
+
5
39
  end
6
40
  end
7
41
  end
@@ -1,3 +1,3 @@
1
1
  module DokkuClient
2
- VERSION = '1.0'
2
+ VERSION = '1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dokku_client
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kuba Łasecki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-27 00:00:00.000000000 Z
11
+ date: 2014-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grit
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: Dokku Client for rails project with preinstalled dokku plugins
70
84
  email:
71
85
  - kubalasecki@gmail.com