dokkufy 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/bin/dokkufy +64 -66
  4. data/lib/dokkufy/info.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffa091fef4ffd1de6b3899b60e1603756555768d
4
- data.tar.gz: 1940c9f1595903306ff99b46acda72d53183b61d
3
+ metadata.gz: b4b1d7d04e4d3451365de3f2d1fcce0e54b1adf9
4
+ data.tar.gz: 8b194433b6e1637a122e1a93638d66c4225174fd
5
5
  SHA512:
6
- metadata.gz: 9592e56d94b21f2696f66e1c5da5e118de28eae3cca87b6f7352890c87b89605ed21521412528d1ba3b0fc93b5e9dd1ad9ed34b64c4cfe2e692f87afe61ad090
7
- data.tar.gz: bd068363826cb8f346520064fb708eb73295fd971129ba9a99352640f5377252ba6cb7950d6b2ceacf435e15b7fced964acfb1b40a1e083961f9cb6c72cbc71b
6
+ metadata.gz: 4116b60507c37a17562b11d1c769b6577ea0185b698cd0e2008e28b9da267a0a357fca8c41ecb1fdac0b45f2eb6176481119a11b0e72c11489d44453c750c653
7
+ data.tar.gz: 8ed8142b4880e8eb72c1fd481166e6ce2c2d5dfbf7d7fb19522128f5047c356313541089f035530864e196bf2978fa4fa33686257c0c375d8ade181d49bc1707
data/README.md CHANGED
@@ -122,6 +122,8 @@ $ ssh -t dokku@example.com run test_app ls
122
122
 
123
123
  ## Release notes
124
124
 
125
+ * **0.1.5** Using classic style commander
126
+ * **0.1.4** Checks for SSH key before installing on server
125
127
  * **0.1.3** Applies double install fix on 14.04
126
128
  * **0.1.0** Adds the `dokku` command
127
129
  * **0.0.7** Adds the (un)dokkufication of apps
data/bin/dokkufy CHANGED
@@ -1,86 +1,84 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'dokkufy'
3
- require 'commander'
3
+ require 'commander/import'
4
4
  require 'terminal-table'
5
5
 
6
- Commander.configure do
7
- program :name, 'Dokkufy'
8
- program :version, Dokkufy::VERSION
9
- program :description, 'An interactive script to enable Dokku on a server'
10
- program :help, 'Author', 'Cristiano Betta <cbetta@gmail.com>'
6
+ program :name, 'Dokkufy'
7
+ program :version, Dokkufy::VERSION
8
+ program :description, 'An interactive script to enable Dokku on a server'
9
+ program :help, 'Author', 'Cristiano Betta <cbetta@gmail.com>'
11
10
 
12
- command :'server' do |c|
13
- c.syntax = 'dokkufy server [<hostname> <username> <domain>]'
14
- c.description = "Installs Dokku on a Ubuntu 12.04 or 14.04 server"
15
- c.option '--version', Float, 'Dokku version'
16
- c.action do |args, options|
17
- hostname = args[0] || ask('Server hostname or IP: ')
18
- username = args[1] || ask('Username on server: ')
19
- domain = args[2] || ask('Desired root domain (e.g. example.com): ')
20
- version = options.version.nil? ? Dokkufy::Utils.stable_version : "v#{options.version}"
11
+ command :'server' do |c|
12
+ c.syntax = 'dokkufy server [<hostname> <username> <domain>]'
13
+ c.description = "Installs Dokku on a Ubuntu 12.04 or 14.04 server"
14
+ c.option '--version', Float, 'Dokku version'
15
+ c.action do |args, options|
16
+ hostname = args[0] || ask('Server hostname or IP: ')
17
+ username = args[1] || ask('Username on server: ')
18
+ domain = args[2] || ask('Desired root domain (e.g. example.com): ')
19
+ version = options.version.nil? ? Dokkufy::Utils.stable_version : "v#{options.version}"
21
20
 
22
- server = Dokkufy::Server.new(hostname, username)
23
- server.dokkufy(version, domain)
24
- end
21
+ server = Dokkufy::Server.new(hostname, username)
22
+ server.dokkufy(version, domain)
25
23
  end
24
+ end
26
25
 
27
- command :'plugin:list' do |c|
28
- c.syntax = 'dokkufy plugin:list'
29
- c.description = "Lists known Dokku plugins"
30
- c.option('--with-notes'){ $with_notes = true }
31
- c.action do |args, options|
32
- puts Terminal::Table.new rows: Dokkufy::Plugin.all($with_notes), headings: ["ID", "Name", "Description"]
33
- end
26
+ command :'plugin:list' do |c|
27
+ c.syntax = 'dokkufy plugin:list'
28
+ c.description = "Lists known Dokku plugins"
29
+ c.option('--with-notes'){ $with_notes = true }
30
+ c.action do |args, options|
31
+ puts Terminal::Table.new rows: Dokkufy::Plugin.all($with_notes), headings: ["ID", "Name", "Description"]
34
32
  end
33
+ end
35
34
 
36
- command :'plugin:install' do |c|
37
- c.syntax = 'dokkufy plugin:install <plugin_name_or_id> [<hostname> <username>]'
38
- c.description = "Installs a known Dokku plugin"
39
- c.action do |args, options|
40
- id_or_name = args[0] || ask('Plugin ID or Name: ')
41
- hostname = args[1] || ask('Server hostname or IP: ')
42
- username = args[2] || ask('Username on server: ')
43
- Dokkufy::Plugin.new(hostname, username).install(id_or_name)
44
- end
35
+ command :'plugin:install' do |c|
36
+ c.syntax = 'dokkufy plugin:install <plugin_name_or_id> [<hostname> <username>]'
37
+ c.description = "Installs a known Dokku plugin"
38
+ c.action do |args, options|
39
+ id_or_name = args[0] || ask('Plugin ID or Name: ')
40
+ hostname = args[1] || ask('Server hostname or IP: ')
41
+ username = args[2] || ask('Username on server: ')
42
+ Dokkufy::Plugin.new(hostname, username).install(id_or_name)
45
43
  end
44
+ end
46
45
 
47
- command :'plugin:uninstall' do |c|
48
- c.syntax = 'dokkufy plugin:uninstall <plugin_name_or_id> [<hostname> <username>]'
49
- c.description = "Uninstalls a known Dokku plugin"
50
- c.action do |args, options|
51
- id_or_name = args[0] || ask('Plugin ID or Name: ')
52
- hostname = args[1] || ask('Server hostname or IP: ')
53
- username = args[2] || ask('Username on server: ')
54
- Dokkufy::Plugin.new(hostname, username).uninstall(id_or_name)
55
- end
46
+ command :'plugin:uninstall' do |c|
47
+ c.syntax = 'dokkufy plugin:uninstall <plugin_name_or_id> [<hostname> <username>]'
48
+ c.description = "Uninstalls a known Dokku plugin"
49
+ c.action do |args, options|
50
+ id_or_name = args[0] || ask('Plugin ID or Name: ')
51
+ hostname = args[1] || ask('Server hostname or IP: ')
52
+ username = args[2] || ask('Username on server: ')
53
+ Dokkufy::Plugin.new(hostname, username).uninstall(id_or_name)
56
54
  end
55
+ end
57
56
 
58
- command :'app' do |c|
59
- c.syntax = 'dokkufy app <git_repo> [OR <hostname> <dokku_username>]'
60
- c.description = "Binds this app to a Dokku instance through git and a config file"
61
- c.action do |args, options|
62
- if args.empty?
63
- git = Dokkufy::Git.new
64
- if git.dokku_remote_present?
65
- args = [git.dokku_remote]
66
- else
67
- hostname = ask('Server hostname or IP: ')
68
- username = ask('Dokku username on server [dokku]: ')
69
- username = "dokku" if username.strip == ""
70
- args = [hostname, username]
71
- end
57
+ command :'app' do |c|
58
+ c.syntax = 'dokkufy app <git_repo> [OR <hostname> <dokku_username>]'
59
+ c.description = "Binds this app to a Dokku instance through git and a config file"
60
+ c.action do |args, options|
61
+ if args.empty?
62
+ git = Dokkufy::Git.new
63
+ if git.dokku_remote_present?
64
+ args = [git.dokku_remote]
65
+ else
66
+ hostname = ask('Server hostname or IP: ')
67
+ username = ask('Dokku username on server [dokku]: ')
68
+ username = "dokku" if username.strip == ""
69
+ args = [hostname, username]
72
70
  end
73
- Dokkufy::App.new(args).dokkufy
74
71
  end
72
+ Dokkufy::App.new(args).dokkufy
75
73
  end
74
+ end
76
75
 
77
- command :'app:clear' do |c|
78
- c.syntax = 'dokkufy app:clear'
79
- c.description = "Undokkufies this app"
80
- c.action do |args, options|
81
- Dokkufy::Git.new.clear
82
- end
76
+ command :'app:clear' do |c|
77
+ c.syntax = 'dokkufy app:clear'
78
+ c.description = "Undokkufies this app"
79
+ c.action do |args, options|
80
+ Dokkufy::Git.new.clear
83
81
  end
84
-
85
- default_command :help
86
82
  end
83
+
84
+ default_command :help
data/lib/dokkufy/info.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dokkufy
2
- VERSION = "0.1.4" unless defined? Dokkufy::VERSION
2
+ VERSION = "0.1.5" unless defined? Dokkufy::VERSION
3
3
  NAME = "dokkufy" unless defined? Dokkufy::NAME
4
4
  DESCRIPTION = "A Dokku toolchain" unless defined? Dokkufy::DESCRIPTION
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dokkufy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cristiano Betta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-17 00:00:00.000000000 Z
11
+ date: 2014-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander