dokku_client 0.1 → 0.2

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: 610b5c208df2d84c7fd15b99fbefd8dd2581bec2
4
- data.tar.gz: f1eac7007426caff8b017c3ea687fe703bf59dc8
3
+ metadata.gz: e3e63333a44b66b0d209f14dc341a06b8eb75f84
4
+ data.tar.gz: 9fd44f512d6a3ec8c628c49936356d535ab10d60
5
5
  SHA512:
6
- metadata.gz: 4c55277cfa55964e6d99c2e128f10217b024722e329b33fb0fcb4e9ed79ebe93c1b6d01c467a8aa1cfeb51203d6e98c40824f6ae6e4792bb3e4e18babf01ece2
7
- data.tar.gz: 67eca77a80a09a11eaff231ab376c3298f046cf58a311aa5055572157dfb127944321b07c99a8c279971d6af25059705ed29976db2b33c419c6e13fbd7b32b12
6
+ metadata.gz: 500d0bd6ec5e18d589a2714de936b0def93b325aa22ade8290d66e54be9db2ca44f2f8945b022b8d5e198b2302443af431e347858dd0010ec52c25c067c84a37
7
+ data.tar.gz: 2c791c5040a6690cc38b337c4a832791791d47098c23e23bee824c6bdabe981a52dabd09e52d5b5ed3de90496d52467f81354ab2a5498b2b086c097f59800055
data/README.md CHANGED
@@ -0,0 +1,55 @@
1
+ # DokkuClient
2
+
3
+ [![weasel](http://www.chromosomechronicles.com/wp-content/uploads/2010/03/i-am-weasel.jpg)](https://github.com/kubalasecki/dokku_client)
4
+
5
+ DokkuClient ...
6
+
7
+ ## Installation
8
+
9
+ Install it yourself as:
10
+
11
+ $ gem install dokku_client
12
+
13
+ ## Configuration
14
+
15
+ $ dokku reconfig
16
+
17
+ Show help
18
+
19
+ dokku help
20
+
21
+ or
22
+
23
+ dokku --help
24
+
25
+ Available commands
26
+
27
+ dokku logs
28
+ dokku config
29
+ dokku get_config
30
+ dokku set_config
31
+ dokku unset_config
32
+
33
+ ## Roadmap
34
+
35
+ ### 0.2 Current release
36
+
37
+ * **TODO** more commands
38
+
39
+ ### 0.1
40
+
41
+ * gem basic structure
42
+ * logs command
43
+ * config option per project
44
+
45
+ ## Contributing
46
+
47
+ 1. Fork it
48
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
49
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
50
+ 4. Push to the branch (`git push origin my-new-feature`)
51
+ 5. Create new Pull Request
52
+
53
+ ## Thanks
54
+
55
+ This gem is inspired by https://github.com/lubieniebieski/pivo_flow. Thanks to it's author for the inspiration and idea.
@@ -26,6 +26,22 @@ module DokkuClient
26
26
  dokku_object.logs
27
27
  end
28
28
 
29
+ def config
30
+ dokku_object.variables
31
+ end
32
+
33
+ def set_config config
34
+ dokku_object.set_variables(config)
35
+ end
36
+
37
+ def get_config key
38
+ dokku_object.get_variables(key)
39
+ end
40
+
41
+ def unset_config keys
42
+ dokku_object.unset_variables(keys)
43
+ end
44
+
29
45
  def reconfig
30
46
  DokkuClient::Base.new.reconfig
31
47
  end
@@ -58,8 +74,12 @@ module DokkuClient
58
74
  opt_parser = OptionParser.new do |opts|
59
75
  opts.banner = "\nDokkuClient ver. #{DokkuClient::VERSION}\nUsage: dokku <COMMAND> [OPTIONS]\n"
60
76
  opts.separator "Commands"
61
- opts.separator " logs show app logs"
62
- opts.separator " version show gem version"
77
+ opts.separator " logs show app logs"
78
+ opts.separator " version show gem version"
79
+ opts.separator " config show environment variables for project"
80
+ opts.separator " get_config <KEY> show exact environment variable"
81
+ opts.separator " set_config KEY=VALUE [KEY2=VALUE2] set new environment variables"
82
+ opts.separator " unset_config KEY [KEY2] remove environment variables"
63
83
  opts.separator ""
64
84
  opts.separator "Options"
65
85
 
@@ -86,11 +106,11 @@ module DokkuClient
86
106
  opt_parser.parse!(args)
87
107
 
88
108
  case args[0]
89
- when "blabla"
109
+ when "set_config", "get_config", "unset_config"
90
110
  self.send(args[0].to_sym, args[1])
91
111
  when "help"
92
112
  puts opt_parser
93
- when "logs", "reconfig"
113
+ when "logs", "reconfig", "config"
94
114
  self.send(args[0].to_sym)
95
115
  when nil
96
116
  no_method_error
@@ -8,6 +8,22 @@ module DokkuClient
8
8
  dokku "logs #{@options["project-name"]}"
9
9
  end
10
10
 
11
+ def variables
12
+ dokku "config #{@options["project-name"]}"
13
+ end
14
+
15
+ def set_variables keys_with_values
16
+ dokku "config:set #{@options["project-name"]} #{keys_with_values}"
17
+ end
18
+
19
+ def get_variable key
20
+ dokku "config:get #{@options["project-name"]} #{key}"
21
+ end
22
+
23
+ def unset_variables keys
24
+ dokku "config:unset #{@options["project-name"]} #{keys}"
25
+ end
26
+
11
27
  def dokku arg
12
28
  no_argument_error if arg.nil?
13
29
  exec "ssh", "-t", "dokku@#{@options["project-host"]}", arg
@@ -1,3 +1,3 @@
1
1
  module DokkuClient
2
- VERSION = '0.1'
2
+ VERSION = '0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dokku_client
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kuba Łasecki