dokkufy 0.0.7 → 0.1.0

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: 04789fa5bbd4f59f47a969ef3a5ddb13a64c221b
4
- data.tar.gz: 961bff96b825c09fdcd7cbef8b022cbe6b32bf0d
3
+ metadata.gz: 2a5fbd971614a49e1d38fb65cee53959a32ad8e9
4
+ data.tar.gz: 82891b6ff6a0284dc896f6912b25e5b00bb0870b
5
5
  SHA512:
6
- metadata.gz: 13dcbb9bd528df50311a78f217aafde4febcf5c337df9c0de1e9aa832edebfdfdbfd71d7b97b86cd07b072d420ccf23f7bcd7f8582f4aabb20ff5cfbcb184176
7
- data.tar.gz: 0902c6fc1876b6614362d005b29c7126963b3334297198abe55b3f62a577c5493f6e0c4b855057548888a0e81346bcac37cd031194019e0bd4a75ec121d5879e
6
+ metadata.gz: 331c2434da0c75e00f9d5004adae4cafacb53e6868a111d9f6f27ef6a66dd0520ff65ed06927162237659c8ca6cc5cef631522e239a6352bc969fac61c8fa16d
7
+ data.tar.gz: 391d73568f03cf840190a58941bea2cc47aeff03b9a1f83c4914be2efd8bf0aff2c14aa48feee861ce6894d28c12901c05e0832079efa88241c75f03e645f376
data/README.md CHANGED
@@ -2,7 +2,20 @@
2
2
 
3
3
  A [Dokku](https://github.com/progrium/dokku) toolbelt inspired by the [Heroku toolbelt](https://toolbelt.heroku.com/)
4
4
 
5
- ## Planned commands
5
+ ## Basic usage
6
+
7
+ Want to build your own Heroku? Dokku and Dokkufy make this possible.
8
+
9
+ 1. Spin up a Ubuntu 12.04 or 14.04 server
10
+ 2. Dokkufy your server using `dokkufy server`
11
+ 3. Change directories to your app
12
+ 4. Dokkufy your app `dokkufy app`
13
+ 5. Deploy your app `git push dokku master`
14
+ 6. Control your app using the `dokku` command (see `dokku help` for available commands)
15
+
16
+ ## Commands
17
+
18
+ Most commands take their parameters as command line arguments or through an interactive prompt.
6
19
 
7
20
  ```
8
21
  dokkufy <command>
@@ -18,10 +31,6 @@ dokkufy <command>
18
31
  dokku <command> runs dokku commands on the server attached to this app
19
32
  ```
20
33
 
21
- ## Implemented commands
22
-
23
- Most commands take their parameters as command line arguments or through an interactive prompt.
24
-
25
34
  ### dokkufy server
26
35
 
27
36
  ```sh
@@ -74,8 +83,37 @@ dokkufy app:clear
74
83
 
75
84
  Removes any `dokku` remotes for the local git repository and deletes the `.dokkurc` file.
76
85
 
86
+ ### dokku
87
+
88
+ ```sh
89
+ dokku <command>
90
+ ```
91
+
92
+ Runs the command on the Dokku server attached to this app. Intelligently determines the remote address if the app has been dokkufied, and automatically adds the app name where needed.
93
+
94
+ Some examples:
95
+
96
+ ```sh
97
+ dokku help # runs `dokku help` on server
98
+ dokku run ls # runs `dokku run <app_name> ls` on server
99
+ ```
100
+
101
+ Every `dokku` command translates to an auto generated ssh call. The `<app_name>` is automatically added if the response returns a "App <command> not found".
102
+
103
+ Some examples
104
+
105
+ ```sh
106
+ cat .dokkurc # content of the .dokkurc
107
+ $ dokku@example.com:test_app
108
+ dokku help
109
+ $ ssh -t dokku@example.com help # the actual command executed
110
+ dokku run ls # a command that requires an app name
111
+ $ ssh -t dokku@example.com run test_app ls
112
+ ```
113
+
77
114
  ## Release notes
78
115
 
116
+ * **0.1.0** Adds the `dokku` command
79
117
  * **0.0.7** Adds the (un)dokkufication of apps
80
118
  * **0.0.6** Adds plugin uninstall
81
119
  * **0.0.5** Small bug fix to plugin installs
data/bin/dokku ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ require 'dokkufy'
3
+
4
+ git = Dokkufy::Git.new
5
+ if !git.dokku_remote_present?
6
+ puts "No Dokku remote found. Run `dokkufy app` first."
7
+ else
8
+ Dokkufy::Dokku.new(git.dokku_remote).run(ARGV)
9
+ end
data/lib/dokkufy/app.rb CHANGED
@@ -22,6 +22,7 @@ module Dokkufy
22
22
  def dokkufy
23
23
  puts "Using #{repo}"
24
24
  Dokkufy::Git.new.dokku_remote = repo
25
+ puts "You can now push your app using `git push dokku master`"
25
26
  end
26
27
 
27
28
  end
@@ -0,0 +1,33 @@
1
+ module Dokkufy
2
+ class Dokku
3
+ attr_accessor :repo
4
+
5
+ def initialize repo
6
+ self.repo = repo
7
+ end
8
+
9
+ def run args
10
+ output = `#{command(args)}`
11
+ if output.strip.end_with?("does not exist")
12
+ args = args.insert(1,app_name)
13
+ output = `#{command(args)}`
14
+ end
15
+ puts output
16
+ end
17
+
18
+ private
19
+
20
+ def command args
21
+ command = "ssh -t -q #{server} #{args.join(" ")}"
22
+ end
23
+
24
+ def server
25
+ @server ||= self.repo.split(":").first
26
+ end
27
+
28
+ def app_name
29
+ @app_name ||= self.repo.split(":").last
30
+ end
31
+
32
+ end
33
+ end
data/lib/dokkufy/info.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dokkufy
2
- VERSION = "0.0.7" unless defined? Dokkufy::VERSION
2
+ VERSION = "0.1.0" 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
data/lib/dokkufy.rb CHANGED
@@ -4,6 +4,7 @@ require 'dokkufy/server'
4
4
  require 'dokkufy/plugin'
5
5
  require 'dokkufy/app'
6
6
  require 'dokkufy/git'
7
+ require 'dokkufy/dokku'
7
8
 
8
9
  module Dokkufy
9
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dokkufy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cristiano Betta
@@ -56,6 +56,7 @@ description: A Dokku toolchain
56
56
  email:
57
57
  - cbetta@gmail.com
58
58
  executables:
59
+ - dokku
59
60
  - dokkufy
60
61
  extensions: []
61
62
  extra_rdoc_files: []
@@ -66,10 +67,12 @@ files:
66
67
  - LICENSE
67
68
  - README.md
68
69
  - Rakefile
70
+ - bin/dokku
69
71
  - bin/dokkufy
70
72
  - dokkufy.gemspec
71
73
  - lib/dokkufy.rb
72
74
  - lib/dokkufy/app.rb
75
+ - lib/dokkufy/dokku.rb
73
76
  - lib/dokkufy/git.rb
74
77
  - lib/dokkufy/info.rb
75
78
  - lib/dokkufy/plugin.rb