rumination 0.13.1 → 0.13.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/lib/rumination/version.rb +1 -1
- metadata +1 -4
- data/lib/rumination/deploy/base.rb +0 -57
- data/lib/rumination/docker_compose/container.rb +0 -54
- data/lib/rumination/docker_compose/sh.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20f4845afaa4f3b3d49bcc74556769df5a13a5ab
|
4
|
+
data.tar.gz: ea3240b0b35c23d2fc5bb5b0dee7d2dd4e7511d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e79e99f4816d70fa80c8a33a2aea8b12ff6044089b1a40b34ff2b05d8fa05a98b61fc1c4c2b00948cc5e31de9d8389c9519d92dcc9804249494d244886183abf
|
7
|
+
data.tar.gz: 780000452b75562cce550673a91ab040701d29b8904e5aacab4267104f7db99a79ee8d573ee02548d6bf335ce6698020b367f3c84e4d26ed77ee492aa0b63e76
|
data/lib/rumination/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rumination
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Baguinski
|
@@ -142,12 +142,9 @@ files:
|
|
142
142
|
- bin/setup
|
143
143
|
- lib/rumination.rb
|
144
144
|
- lib/rumination/deploy.rb
|
145
|
-
- lib/rumination/deploy/base.rb
|
146
145
|
- lib/rumination/deploy/class_methods.rb
|
147
146
|
- lib/rumination/dev_user.rb
|
148
147
|
- lib/rumination/docker_compose.rb
|
149
|
-
- lib/rumination/docker_compose/container.rb
|
150
|
-
- lib/rumination/docker_compose/sh.rb
|
151
148
|
- lib/rumination/generate.rb
|
152
149
|
- lib/rumination/pg.rb
|
153
150
|
- lib/rumination/pg/commands.rb
|
@@ -1,57 +0,0 @@
|
|
1
|
-
require "fileutils"
|
2
|
-
require "dotenv/parser"
|
3
|
-
require "active_support/core_ext/module/delegation"
|
4
|
-
require "active_support/core_ext/object/blank"
|
5
|
-
require_relative "../docker_compose"
|
6
|
-
|
7
|
-
module Rumination
|
8
|
-
module Deploy
|
9
|
-
class Base
|
10
|
-
delegate :config, to: Deploy
|
11
|
-
|
12
|
-
private
|
13
|
-
|
14
|
-
def copy_dump_if_requested
|
15
|
-
source = config.copy_dumpfile
|
16
|
-
return unless source.present?
|
17
|
-
return unless File.exists?(source)
|
18
|
-
target = Rumination.config.pg.dumpfile_path
|
19
|
-
app_container.cp_to_container source, target
|
20
|
-
end
|
21
|
-
|
22
|
-
def target_config_path
|
23
|
-
(config.target_config_path || "./config/deploy/targets/%s.rb") % target
|
24
|
-
end
|
25
|
-
|
26
|
-
|
27
|
-
def docker_machine_env
|
28
|
-
dm_env_str = if config.docker_machine
|
29
|
-
`docker-machine env #{config.docker_machine}`
|
30
|
-
else
|
31
|
-
""
|
32
|
-
end
|
33
|
-
Dotenv::Parser.call(dm_env_str)
|
34
|
-
end
|
35
|
-
|
36
|
-
def bootstrapped?
|
37
|
-
app_container.has_file?(env_file_path)
|
38
|
-
end
|
39
|
-
|
40
|
-
def container(name)
|
41
|
-
DockerCompose::Container.new(name)
|
42
|
-
end
|
43
|
-
|
44
|
-
def app_container_name
|
45
|
-
config.app_countainer || :app
|
46
|
-
end
|
47
|
-
|
48
|
-
def app_container
|
49
|
-
container(app_container_name)
|
50
|
-
end
|
51
|
-
|
52
|
-
def cached_gems?
|
53
|
-
target.to_sym == :development
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
require "dotenv/parser"
|
2
|
-
require_relative "sh"
|
3
|
-
|
4
|
-
module Rumination
|
5
|
-
module DockerCompose
|
6
|
-
Container = Struct.new(:name) do
|
7
|
-
include Sh
|
8
|
-
|
9
|
-
def has_file?(path)
|
10
|
-
run "test -f #{path}"
|
11
|
-
$? == 0
|
12
|
-
end
|
13
|
-
|
14
|
-
def up?
|
15
|
-
exec "true"
|
16
|
-
$? == 0
|
17
|
-
end
|
18
|
-
|
19
|
-
def exec command, *args
|
20
|
-
sh "docker-compose exec", name, command, *args
|
21
|
-
self
|
22
|
-
end
|
23
|
-
|
24
|
-
def run command, *args
|
25
|
-
sh "docker-compose run --rm", name, command, *args
|
26
|
-
self
|
27
|
-
end
|
28
|
-
|
29
|
-
def restart *args
|
30
|
-
sh "docker-compose restart", name, *args
|
31
|
-
self
|
32
|
-
end
|
33
|
-
|
34
|
-
def cp_to_container local_path, container_path, *args
|
35
|
-
args << local_path
|
36
|
-
args << "#{full_name}:#{container_path}"
|
37
|
-
sh "docker cp", *args
|
38
|
-
end
|
39
|
-
|
40
|
-
def full_name
|
41
|
-
"#{compose_project_name}_#{name}_1"
|
42
|
-
end
|
43
|
-
|
44
|
-
def compose_project_name
|
45
|
-
env = if File.exists?(".env")
|
46
|
-
Dotenv::Parser.call(File.read(".env"))
|
47
|
-
else
|
48
|
-
{}
|
49
|
-
end
|
50
|
-
env["COMPOSE_PROJECT_NAME"] || File.basename(Dir.pwd)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|