dokku-installer-cli 0.1.1 → 0.1.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: f08fede5e7f13bc4e2417684676a6e2cacae5141
4
- data.tar.gz: 8cf626d47a978bb9ad6f64ca36143600c1bb20b4
3
+ metadata.gz: 4c58e7bdae88a45380d380daf693545cb54a456e
4
+ data.tar.gz: 1bee3b376ba7bafa373dbf982762da12c314115d
5
5
  SHA512:
6
- metadata.gz: 8a5e82b061e82048f49f63f7ce5cf198dce35921a0ef277a8f5d53fffb64e5ac629b6469eb872ef2f091c9cf33a1a22e5f1db3dc9091605eacff1ad49b07b37c
7
- data.tar.gz: b5ace042975f8b4a6e8a7979384e0e66ae0cac7b5a4a8a13745cc9bff51bac2d19c69a64a1052853854e5f046ece685e6e0a81d42558278dd32478f953cc37b1
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
@@ -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.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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dokku-installer-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Pattison