dokkufy 0.0.4 → 0.0.5
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 +24 -2
- data/bin/dokkufy +2 -6
- data/lib/dokkufy/info.rb +1 -1
- data/lib/dokkufy/plugin.rb +19 -9
- data/lib/dokkufy/server.rb +9 -2
- data/scripts/configure_vhost.sh +1 -1
- data/scripts/install_dokku.sh +1 -1
- data/scripts/install_plugin.sh +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 105fbfc0e0dc47918f360cdb2ca51e71f16477ac
|
4
|
+
data.tar.gz: db0cc58a072c41305e876deac01f7e357669baaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21d64a72135fdef4fd796e32ae00440f399be509ce55ec60980824d51b564102e20cdb3c2f27cc570615a29722c5a4932018f499466b173141ff3b44e7eb6d3f
|
7
|
+
data.tar.gz: f724b939f2b53f712062e0d8e5c4b5ba5b0995f8197193bd4946799d4756a16be4b9d99c2782d3e2d60000ef23f9bcc0175348050259db5ed0da370e5c8fabc5
|
data/README.md
CHANGED
@@ -9,8 +9,9 @@ dokkufy <command>
|
|
9
9
|
help shows this list
|
10
10
|
server installs Dokku on a Ubuntu 12.04 or 14.04 server
|
11
11
|
server:upgrade upgrades a Dokku server
|
12
|
-
plugin
|
12
|
+
plugin:list shows a list of Dokku plugins
|
13
13
|
plugin:install installs a plugin on the server
|
14
|
+
plugin:uninstall uninstalls a plugin on the server
|
14
15
|
app adds a dokku remote for a server to an app
|
15
16
|
|
16
17
|
dokku <command> runs dokku commands on the server attached to this app
|
@@ -18,19 +19,40 @@ dokku <command> runs dokku commands on the server attached to this app
|
|
18
19
|
|
19
20
|
## Implemented commands
|
20
21
|
|
22
|
+
Most commands take their parameters as command line arguments or through an interactive prompt.
|
23
|
+
|
21
24
|
### dokkufy server
|
22
25
|
|
23
26
|
```sh
|
24
27
|
dokkufy server <hostname> <username> <domain> --version <version>
|
25
28
|
```
|
26
29
|
|
27
|
-
Installs
|
30
|
+
Installs Dokku on server at IP or Hostname `<hostname>`, using the `<username>` account to install the software.
|
28
31
|
|
29
32
|
It also sets up the app on domain `<domain>`, resulting in all apps being served as a subdomain of that domain.
|
30
33
|
|
31
34
|
Optionally this takes a `<version>` to specify the [Dokku tag](https://github.com/progrium/dokku/tags).
|
35
|
+
|
36
|
+
### dokkufy plugin:list
|
37
|
+
|
38
|
+
```sh
|
39
|
+
dokkufy plugin:list
|
40
|
+
```
|
41
|
+
|
42
|
+
Lists all plugins as listed on the [Dokku wiki](https://github.com/progrium/dokku/wiki/Plugins). Only supports plugins that follow the standard install procedure.
|
43
|
+
|
44
|
+
### dokkufy plugin:install
|
45
|
+
|
46
|
+
```sh
|
47
|
+
dokkufy plugin:install <plugin_name_or_id> [<hostname> <username>]
|
48
|
+
```
|
49
|
+
|
50
|
+
Installs a Dokku plugin either by name or ID (as received by `dokkufy plugin:list`) on a server. Only supports the standard install procedure. Check the plugins wiki for any additional install notes.
|
51
|
+
|
32
52
|
## Release notes
|
33
53
|
|
54
|
+
* **0.0.5** Small bug fix to plugin installs
|
55
|
+
* **0.0.4** Adds plugin listing and installing
|
34
56
|
* **0.0.3** Determines latest version from Dokku github page
|
35
57
|
* **0.0.2** Added `server` command
|
36
58
|
* **0.0.1** Gem skeleton
|
data/bin/dokkufy
CHANGED
@@ -20,10 +20,7 @@ Commander.configure do
|
|
20
20
|
version = options.version.nil? ? Dokkufy::Utils.stable_version : "v#{options.version}"
|
21
21
|
|
22
22
|
server = Dokkufy::Server.new(hostname, username)
|
23
|
-
server.
|
24
|
-
server.install_dokku(version)
|
25
|
-
server.configure_vhost(domain)
|
26
|
-
server.setup_key
|
23
|
+
server.dokkufy(version, domain)
|
27
24
|
end
|
28
25
|
end
|
29
26
|
|
@@ -32,8 +29,7 @@ Commander.configure do
|
|
32
29
|
c.description = "Lists known Dokku plugins"
|
33
30
|
c.option('--with-notes'){ $with_notes = true }
|
34
31
|
c.action do |args, options|
|
35
|
-
|
36
|
-
puts Terminal::Table.new rows: plugins, headings: ["ID", "Name", "Description"]
|
32
|
+
puts Terminal::Table.new rows: Dokkufy::Plugin.all($with_notes), headings: ["ID", "Name", "Description"]
|
37
33
|
end
|
38
34
|
end
|
39
35
|
|
data/lib/dokkufy/info.rb
CHANGED
data/lib/dokkufy/plugin.rb
CHANGED
@@ -4,7 +4,7 @@ require 'hpricot'
|
|
4
4
|
module Dokkufy
|
5
5
|
class Plugin
|
6
6
|
|
7
|
-
attr_accessor :hostname, :username, :
|
7
|
+
attr_accessor :hostname, :username, :path
|
8
8
|
|
9
9
|
def initialize hostname, username
|
10
10
|
self.hostname = hostname
|
@@ -12,18 +12,20 @@ module Dokkufy
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def install id_or_name
|
15
|
-
self.
|
16
|
-
Dokkufy::Server.new(hostname, username).install_plugin(
|
15
|
+
self.path = id_or_name
|
16
|
+
Dokkufy::Server.new(hostname, username).install_plugin(path, name)
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.all with_notes = false
|
20
|
+
return @plugins if @plugins
|
20
21
|
open("https://github.com/progrium/dokku/wiki/Plugins") do |f|
|
21
22
|
hp = Hpricot(f)
|
22
|
-
plugins = hp.search("tbody
|
23
|
-
|
23
|
+
plugins = hp.search("tbody tr td").each_slice(3)
|
24
|
+
@plugins = plugins.each_with_index.map do |plugin, index|
|
25
|
+
first_element = plugin.first.children.reject{|e| e.inner_text.strip == ""}.first
|
24
26
|
entry = [index+1,
|
25
|
-
|
26
|
-
|
27
|
+
first_element.attributes["href"].split("github.com/").last,
|
28
|
+
first_element.inner_text]
|
27
29
|
entry << plugin.last.inner_text if with_notes
|
28
30
|
entry
|
29
31
|
end
|
@@ -32,11 +34,11 @@ module Dokkufy
|
|
32
34
|
|
33
35
|
private
|
34
36
|
|
35
|
-
def
|
37
|
+
def path=(id_or_name)
|
36
38
|
if id_or_name.to_i.to_s == id_or_name
|
37
39
|
Dokkufy::Plugin.all.each do |plugin|
|
38
40
|
if plugin[0] == id_or_name.to_i
|
39
|
-
@
|
41
|
+
@path = plugin[1]
|
40
42
|
return
|
41
43
|
end
|
42
44
|
end
|
@@ -45,6 +47,14 @@ module Dokkufy
|
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
50
|
+
def name
|
51
|
+
Dokkufy::Plugin.all.each do |plugin|
|
52
|
+
if plugin[1] == path
|
53
|
+
return plugin[2].split(" ").first.downcase
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
48
58
|
|
49
59
|
end
|
50
60
|
end
|
data/lib/dokkufy/server.rb
CHANGED
@@ -7,6 +7,13 @@ module Dokkufy
|
|
7
7
|
self.username = username
|
8
8
|
end
|
9
9
|
|
10
|
+
def dokkufy(version, domain)
|
11
|
+
ensure_passwordless_sudo
|
12
|
+
install_dokku(version)
|
13
|
+
configure_vhost(domain)
|
14
|
+
setup_key
|
15
|
+
end
|
16
|
+
|
10
17
|
def setup_key
|
11
18
|
user = `echo $USER`
|
12
19
|
command = "cat ~/.ssh/id_rsa.pub | ssh #{username}@#{hostname} 'sudo sshcommand acl-add dokku #{user}'"
|
@@ -18,8 +25,8 @@ module Dokkufy
|
|
18
25
|
filename = Dokkufy::Utils.script method_name
|
19
26
|
server = "#{username}@#{hostname}"
|
20
27
|
`scp #{filename} #{server}:`
|
21
|
-
system("ssh -t #{server} '
|
22
|
-
`ssh -t -q #{server} 'rm
|
28
|
+
system("ssh -t #{server} 'OPTION1=#{args[0]} OPTION2=#{args[1]} ./#{method_name}.sh'")
|
29
|
+
`ssh -t -q #{server} 'rm ~/#{method_name}.sh'`
|
23
30
|
end
|
24
31
|
end
|
25
32
|
end
|
data/scripts/configure_vhost.sh
CHANGED
@@ -1 +1 @@
|
|
1
|
-
sudo bash -c "echo $
|
1
|
+
sudo bash -c "echo $OPTION1 > /home/dokku/VHOST"
|
data/scripts/install_dokku.sh
CHANGED
@@ -6,4 +6,4 @@ if [ "$VERSION" == "$OLD_VERSION" ]; then
|
|
6
6
|
sudo apt-get install -y python-software-properties
|
7
7
|
fi
|
8
8
|
|
9
|
-
wget -qO- https://raw.github.com/progrium/dokku/$
|
9
|
+
wget -qO- https://raw.github.com/progrium/dokku/$OPTION1/bootstrap.sh | sudo DOKKU_TAG=v0.2.3 bash
|
data/scripts/install_plugin.sh
CHANGED
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.0.
|
4
|
+
version: 0.0.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-
|
11
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|