dokku_client 0.1 → 0.2
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 +55 -0
- data/lib/dokku_client/cli.rb +24 -4
- data/lib/dokku_client/client.rb +16 -0
- data/lib/dokku_client/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: e3e63333a44b66b0d209f14dc341a06b8eb75f84
|
4
|
+
data.tar.gz: 9fd44f512d6a3ec8c628c49936356d535ab10d60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 500d0bd6ec5e18d589a2714de936b0def93b325aa22ade8290d66e54be9db2ca44f2f8945b022b8d5e198b2302443af431e347858dd0010ec52c25c067c84a37
|
7
|
+
data.tar.gz: 2c791c5040a6690cc38b337c4a832791791d47098c23e23bee824c6bdabe981a52dabd09e52d5b5ed3de90496d52467f81354ab2a5498b2b086c097f59800055
|
data/README.md
CHANGED
@@ -0,0 +1,55 @@
|
|
1
|
+
# DokkuClient
|
2
|
+
|
3
|
+
[](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.
|
data/lib/dokku_client/cli.rb
CHANGED
@@ -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
|
62
|
-
opts.separator " 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 "
|
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
|
data/lib/dokku_client/client.rb
CHANGED
@@ -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
|
data/lib/dokku_client/version.rb
CHANGED