dokku-installer-cli 0.1.1 → 0.1.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/bin/dokku +0 -5
- data/lib/dokku_installer/ssl.rb +0 -8
- data/lib/dokku_installer/version.rb +57 -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: 4c58e7bdae88a45380d380daf693545cb54a456e
|
4
|
+
data.tar.gz: 1bee3b376ba7bafa373dbf982762da12c314115d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d8c7e0c230d043a6518b7174aeab7d416125b21385bfc873a3d46379dcc2500fe096d6f9f932cd634227f27177e1894f1bb0ce8806dbe1d74c1796d2f2d99a1
|
7
|
+
data.tar.gz: bc6dac8fa9bcea34fd866917010b2e4d19ecedda5fa9eed3804e6f8ef3985cef50a2a55e2e3a8366a4504ac75c35c416848ccba9f8a2b5a6bb5715deb6d2b48e
|
data/bin/dokku
CHANGED
@@ -53,11 +53,6 @@ module DokkuInstaller
|
|
53
53
|
puts "http://#{app_name}.#{domain}"
|
54
54
|
end
|
55
55
|
|
56
|
-
desc "version", "Show dokku-installer-cli's version"
|
57
|
-
def version
|
58
|
-
puts "Dokku Installer CLI #{DokkuInstaller::VERSION}"
|
59
|
-
end
|
60
|
-
|
61
56
|
def help(method = nil)
|
62
57
|
method = "walk" if method == "run"
|
63
58
|
super
|
data/lib/dokku_installer/ssl.rb
CHANGED
@@ -1,14 +1,6 @@
|
|
1
1
|
module DokkuInstaller
|
2
2
|
class Cli < Thor
|
3
3
|
|
4
|
-
# certs:add CRT KEY # Add an ssl endpoint to an app.
|
5
|
-
# certs:chain CRT [CRT ...] # Print the ordered and complete chain for the given certificate.
|
6
|
-
# certs:info # Show certificate information for an ssl endpoint.
|
7
|
-
# certs:key CRT KEY [KEY ...] # Print the correct key for the given certificate.
|
8
|
-
# certs:remove # Remove an SSL Endpoint from an app.
|
9
|
-
# certs:rollback # Rollback an SSL Endpoint for an app.
|
10
|
-
# certs:update CRT KEY # Update an SSL Endpoint on an app.
|
11
|
-
|
12
4
|
desc "ssl:add CRT KEY", "Add an SSL endpoint."
|
13
5
|
def ssl_add(*args)
|
14
6
|
key = nil
|
@@ -1,3 +1,59 @@
|
|
1
|
+
require "json"
|
2
|
+
require "net/http"
|
3
|
+
require "thor"
|
4
|
+
|
1
5
|
module DokkuInstaller
|
2
|
-
VERSION = "0.1.
|
6
|
+
VERSION = "0.1.2"
|
7
|
+
|
8
|
+
class Cli < Thor
|
9
|
+
|
10
|
+
desc "upgrade", "Upgrade the Dokku install on your remote server"
|
11
|
+
def upgrade
|
12
|
+
command = "ssh -t root@#{domain} \"rm -rf /var/lib/dokku/plugins; cd /root/dokku; git pull origin master; make install\""
|
13
|
+
puts "Running #{command}..."
|
14
|
+
exec(command)
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "update", "Update dokku-installer-cli to latest version"
|
18
|
+
def update
|
19
|
+
command = "gem install dokku-installer-cli"
|
20
|
+
puts "Running #{command}..."
|
21
|
+
exec(command)
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "version", "Show version information"
|
25
|
+
def version
|
26
|
+
gem_version = "v#{DokkuInstaller::VERSION}"
|
27
|
+
|
28
|
+
# Grab the latest version of the RubyGem
|
29
|
+
rubygems_json = Net::HTTP.get("rubygems.org", "/api/v1/gems/dokku-installer-cli.json")
|
30
|
+
rubygems_version = "v#{JSON.parse(rubygems_json)["version"].strip}"
|
31
|
+
|
32
|
+
# Grab the version of the remote Dokku install
|
33
|
+
command = "ssh -t dokku@#{domain} version"
|
34
|
+
remote_version = `#{command}`.strip
|
35
|
+
|
36
|
+
upgrade_message = ""
|
37
|
+
if gem_version != rubygems_version
|
38
|
+
upgrade_message = " Run `dokku update` to install"
|
39
|
+
end
|
40
|
+
|
41
|
+
puts
|
42
|
+
puts "Dokku Installer CLI"
|
43
|
+
puts " Installed: #{gem_version}"
|
44
|
+
puts " Latest: #{rubygems_version}#{upgrade_message}"
|
45
|
+
puts
|
46
|
+
|
47
|
+
upgrade_message = ""
|
48
|
+
if remote_version != rubygems_version
|
49
|
+
upgrade_message = " Run `dokku upgrade` to install"
|
50
|
+
end
|
51
|
+
|
52
|
+
puts "Remote Dokku Version"
|
53
|
+
puts " Installed: #{remote_version}"
|
54
|
+
puts " Latest: #{rubygems_version}#{upgrade_message}"
|
55
|
+
puts
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
3
59
|
end
|