rumination 0.8.1 → 0.9.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: cb61d7da6535cdcdc5f3e28ca27eef54a85f133c
4
- data.tar.gz: 8f31b9217fcf6fc2e8de1e32bc6972e41c40fe14
3
+ metadata.gz: 12ea68a706a32e7164b3f50169eefff180acdc44
4
+ data.tar.gz: 833f7213b06e7ddd560ef51b33db45f0f1c298f2
5
5
  SHA512:
6
- metadata.gz: 71e0fa0d646a7b031cea6e63f3c3dee74c81620932fb9812d558f2bf663759e33d5171fb7986dc2bbcdc01b1050d762183851a36e08ae4d9fa0775feaf9e7166
7
- data.tar.gz: 3a252f371f88d8ea85a7593c1099441c5d6433568b4caae38ed24143fd463847f05f824474bdeffb1e22558ca28d531bef9d1577db0d74f101d2f3c1552e9df6
6
+ metadata.gz: a806bcb23e63dedb350c6a72de37872d86b1d58cef4526cdbd29bbb6ef59048cfb6c69f0a7d553e7d15ef573181901984b82e371daa837b73f46f13a5b14ba72
7
+ data.tar.gz: 129a240c1a09d5219291d9cb1dc106446424737b0992ce01007532b2f3c31926094dae5ce671083db63a11b4c626e10b95c1df0c230e141872782e5c56ba2a57
@@ -16,7 +16,10 @@ module Rumination
16
16
 
17
17
  def bootstrap
18
18
  call do
19
- on_fresh_containers
19
+ raise BootstrappedAlready if bootstrapped?
20
+ copy_dump_if_requested
21
+ container(:backend).run("rake deploy:bootstrap:inside[#{target}]")
22
+ raise BootstrapError unless $? == 0
20
23
  end
21
24
  end
22
25
 
@@ -66,10 +69,13 @@ module Rumination
66
69
 
67
70
  private
68
71
 
69
- def on_fresh_containers
70
- raise BootstrappedAlready if bootstrapped?
71
- container(:backend).run("rake deploy:bootstrap:inside[#{target}]")
72
- raise BootstrapError unless $? == 0
72
+ def copy_dump_if_requested
73
+ return unless config.copy_dumpfile.present?
74
+ return unless File.exists?(config.copy_dumpfile)
75
+ container(:backend).cp_to_container(
76
+ config.copy_dumpfile,
77
+ Rumination.config.pg.dumpfile_path
78
+ )
73
79
  end
74
80
 
75
81
  def load_application_config_if_exists
@@ -29,6 +29,20 @@ module Rumination
29
29
  sh "docker-compose restart", name, *args
30
30
  self
31
31
  end
32
+
33
+ def cp_to_container local_path, container_path, *args
34
+ args << local_path
35
+ args << "#{full_name}:#{container_path}"
36
+ sh "docker cp", *args
37
+ end
38
+
39
+ def full_name
40
+ "#{compose_project_name}_#{name}"
41
+ end
42
+
43
+ def compose_project_name
44
+ ENV["COMPOSE_PROJECT_NAME"]
45
+ end
32
46
  end
33
47
  end
34
48
  end
@@ -1,3 +1,3 @@
1
1
  module Rumination
2
- VERSION = "0.8.1"
2
+ VERSION = "0.9.0"
3
3
  end
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.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Baguinski