dockland 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +3 -3
- data/lib/dockland.rb +15 -3
- data/lib/dockland/cli.rb +7 -3
- data/lib/dockland/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4aacb5b87342f2c03fafff0f6e2c92fd7231a3c
|
4
|
+
data.tar.gz: 328eb74242dcabc1200ec275068becec660cbf03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ffdd4fe449d8e7576b8344a44df1b8d2cb37be971e91e5d01322b7f3329eebbfdff59429f1c544b8d9e295c773908239fde62142b7c28a6f533b2a51d4b1f35
|
7
|
+
data.tar.gz: 0fed6ecc2b3d0630294ca5326adc9ffc75fc779723df2aaec89ea2d66c9e75414b458c4e15f8831c8c2d34935c57afdd613157960046a66e772edf687d4b5dfc
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -4,13 +4,13 @@ dokku pipeline
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
```
|
7
|
+
```bash
|
8
8
|
$ gem install dockland
|
9
9
|
```
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
13
|
-
```
|
13
|
+
```bash
|
14
14
|
$ cd dokku-ready-project
|
15
15
|
$ git config remote.dokku.url
|
16
16
|
dokku@example.com:dokku-ready-project
|
@@ -28,7 +28,7 @@ KEY1: VALUE
|
|
28
28
|
|
29
29
|
## Contributing
|
30
30
|
|
31
|
-
1. Fork it ( https://github.com/
|
31
|
+
1. Fork it ( https://github.com/oame/dockland/fork )
|
32
32
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
33
33
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
34
34
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/dockland.rb
CHANGED
@@ -4,10 +4,10 @@ require 'dockland/cli'
|
|
4
4
|
module Dockland
|
5
5
|
|
6
6
|
private
|
7
|
-
def self.
|
8
|
-
dokku_uri = `git config remote.dokku.url`.strip
|
7
|
+
def self.parse_git_remote
|
8
|
+
dokku_uri = `git config remote.dokku.url`.strip || `git config remote.deploy.url`.strip
|
9
9
|
if dokku_uri.empty?
|
10
|
-
puts "dokku url not given. please
|
10
|
+
puts "dokku url not given. please run > $ git remote add dokku dokku@<host>:<app_name>"
|
11
11
|
exit
|
12
12
|
end
|
13
13
|
|
@@ -15,4 +15,16 @@ module Dockland
|
|
15
15
|
return { username: username, host: host, app_name: app_name }
|
16
16
|
end
|
17
17
|
|
18
|
+
def self.is_require_app_name?(command)
|
19
|
+
remote = parse_git_remote
|
20
|
+
line = `ssh -t #{remote[:username]}@#{remote[:host]} help 2> /dev/null | grep ' #{command}'`
|
21
|
+
line.include?('<app>')
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.dokku_exec(command, options='')
|
25
|
+
remote = parse_git_remote
|
26
|
+
lines = `ssh -t #{remote[:username]}@#{remote[:host]} #{command} #{remote[:app_name] if is_require_app_name?(command)} #{options} 2> /dev/null`
|
27
|
+
lines.strip
|
28
|
+
end
|
29
|
+
|
18
30
|
end
|
data/lib/dockland/cli.rb
CHANGED
@@ -11,11 +11,15 @@ module Dockland
|
|
11
11
|
puts "AppName: #{remote[:app_name]}"
|
12
12
|
end
|
13
13
|
|
14
|
+
def help
|
15
|
+
puts Dockland.dokku_exec( 'help' )
|
16
|
+
end
|
17
|
+
|
14
18
|
def method_missing(*args)
|
15
19
|
command, *opt = args
|
16
|
-
|
17
|
-
lines =
|
18
|
-
puts lines
|
20
|
+
|
21
|
+
lines = Dockland.dokku_exec( command.to_s, opt.join(' ') )
|
22
|
+
puts lines
|
19
23
|
end
|
20
24
|
|
21
25
|
end
|
data/lib/dockland/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dockland
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- oame
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -61,6 +61,7 @@ extensions: []
|
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
63
|
- ".gitignore"
|
64
|
+
- CHANGELOG.md
|
64
65
|
- Gemfile
|
65
66
|
- LICENSE.txt
|
66
67
|
- README.md
|