dokku_rails 0.0.1
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 +7 -0
- data/Rakefile +1 -0
- data/lib/dokku_rails/commands/apps.rb +26 -0
- data/lib/dokku_rails/commands/config.rb +37 -0
- data/lib/dokku_rails/commands/domains.rb +11 -0
- data/lib/dokku_rails/commands/postgres.rb +21 -0
- data/lib/dokku_rails/commands/run.rb +9 -0
- data/lib/dokku_rails/commands/tar.rb +11 -0
- data/lib/dokku_rails/version.rb +3 -0
- data/lib/dokku_rails.rb +39 -0
- metadata +123 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 05c62240994c03d7ba6afa79b8850db9d7639b1a
|
4
|
+
data.tar.gz: 4f67c6ac825d07740ec7b592d31c9bb228a8f5a9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8e2f87a18fc2a57a79dc7c6811a545177964b0d5dc22ed1f32b308900f07417466a3f1d0efd6348e8af7d70d5c6b6f24d599bba45ff176e392bc185d0174a5aa
|
7
|
+
data.tar.gz: aa4c98c5eea92701830131d29f0503a5e0c4fdaca5da739aea3f1c5d550521dba15a0e0a9c519b8dca258e87982dd18283a05f3076f6c9a0d74e54bbe2158291
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module DokkuRails
|
2
|
+
# @abstract
|
3
|
+
class Apps
|
4
|
+
|
5
|
+
def self.create(name)
|
6
|
+
res = DokkuRails.execute("dokku apps:create #{name}")
|
7
|
+
return res
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.fetch()
|
11
|
+
res = DokkuRails.execute("dokku apps")
|
12
|
+
return res
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.rename(oldapp, newapp)
|
16
|
+
res = DokkuRails.execute("dokku apps:rename #{oldapp} #{newapp}")
|
17
|
+
return res
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.destroy(app)
|
21
|
+
res = DokkuRails.execute("dokku --force apps:destroy #{app}")
|
22
|
+
return res
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module DokkuRails
|
2
|
+
|
3
|
+
# @abstract
|
4
|
+
class Config
|
5
|
+
|
6
|
+
def self.create(app, keys)
|
7
|
+
|
8
|
+
vars = ""
|
9
|
+
|
10
|
+
keys.each do |k, v|
|
11
|
+
vars += '"' + k.to_s.upcase + '"="' + v.to_s + '" '
|
12
|
+
end
|
13
|
+
|
14
|
+
DokkuRails.execute("dokku config:set #{app} #{vars}")
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.fetch(app = nil)
|
19
|
+
res = DokkuRails.execute("dokku config #{app}")
|
20
|
+
s = res.split("\n").drop(1)
|
21
|
+
config_vars = Hash[s.each.map { |l| l.chomp.split(': ',2) }].each{ |k,v| v.gsub! " ","" }
|
22
|
+
|
23
|
+
return config_vars
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.show(app = nil, key)
|
27
|
+
res = DokkuRails.execute("dokku config:get #{app} #{key.upcase}")
|
28
|
+
return res
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.destroy(app = nil, key)
|
32
|
+
res = DokkuRails.execute("dokku config:unset #{app} #{key.upcase}")
|
33
|
+
return res
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module DokkuRails
|
2
|
+
# @abstract
|
3
|
+
class Postgres
|
4
|
+
|
5
|
+
def self.create(name)
|
6
|
+
res = DokkuRails.execute("dokku postgres:create #{name}")
|
7
|
+
return res
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.link(appname, dbname)
|
11
|
+
res = DokkuRails.execute("dokku postgres:link #{appname} #{dbname}")
|
12
|
+
return res
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.destroy(name)
|
16
|
+
res = DokkuRails.execute("dokku --force postgres:destroy #{name}")
|
17
|
+
return res
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
data/lib/dokku_rails.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'net/ssh'
|
2
|
+
|
3
|
+
require 'dokku_rails/version'
|
4
|
+
|
5
|
+
require 'dokku_rails/commands/apps'
|
6
|
+
require 'dokku_rails/commands/config'
|
7
|
+
require 'dokku_rails/commands/domains'
|
8
|
+
require 'dokku_rails/commands/postgres'
|
9
|
+
require 'dokku_rails/commands/run'
|
10
|
+
require 'dokku_rails/commands/tar'
|
11
|
+
|
12
|
+
|
13
|
+
module DokkuRails
|
14
|
+
|
15
|
+
class Configuration
|
16
|
+
attr_accessor :host, :user
|
17
|
+
end
|
18
|
+
|
19
|
+
class << self
|
20
|
+
attr_accessor :config
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.configure
|
24
|
+
self.config ||= Configuration.new
|
25
|
+
yield config
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.execute(cmd)
|
29
|
+
begin
|
30
|
+
ssh = Net::SSH.start(config.host, config.user)
|
31
|
+
res = ssh.exec!(cmd)
|
32
|
+
ssh.close
|
33
|
+
rescue
|
34
|
+
res = "Unable to connect to #{config.host} with user #{config.user}"
|
35
|
+
end
|
36
|
+
|
37
|
+
return res
|
38
|
+
end
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dokku_rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- fearcraftor
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-08-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: net-ssh
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.2'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 3.2.0
|
51
|
+
type: :development
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '3.2'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 3.2.0
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: net-ssh
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '3.2'
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 3.2.0
|
71
|
+
type: :runtime
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '3.2'
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 3.2.0
|
81
|
+
description: Dokku Rails allows developers to execute commands on a Dokku instance
|
82
|
+
directly from their Ruby on Rails app.
|
83
|
+
email:
|
84
|
+
- flelong@live.fr
|
85
|
+
executables: []
|
86
|
+
extensions: []
|
87
|
+
extra_rdoc_files: []
|
88
|
+
files:
|
89
|
+
- Rakefile
|
90
|
+
- lib/dokku_rails.rb
|
91
|
+
- lib/dokku_rails/commands/apps.rb
|
92
|
+
- lib/dokku_rails/commands/config.rb
|
93
|
+
- lib/dokku_rails/commands/domains.rb
|
94
|
+
- lib/dokku_rails/commands/postgres.rb
|
95
|
+
- lib/dokku_rails/commands/run.rb
|
96
|
+
- lib/dokku_rails/commands/tar.rb
|
97
|
+
- lib/dokku_rails/version.rb
|
98
|
+
homepage: https://github.com/fearcraftor/dokku_rails
|
99
|
+
licenses:
|
100
|
+
- MIT
|
101
|
+
metadata:
|
102
|
+
allowed_push_host: https://rubygems.org
|
103
|
+
post_install_message:
|
104
|
+
rdoc_options: []
|
105
|
+
require_paths:
|
106
|
+
- lib
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
requirements: []
|
118
|
+
rubyforge_project:
|
119
|
+
rubygems_version: 2.5.1
|
120
|
+
signing_key:
|
121
|
+
specification_version: 4
|
122
|
+
summary: Simple Dokku client to use with you Ruby on Rails project
|
123
|
+
test_files: []
|