rumination 0.14.4 → 0.14.5

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: 9c0a3cc67e4fce1809915c6cf47aa59a8f17667b
4
- data.tar.gz: d696076be2eedb7704518d858414025938f5c45b
3
+ metadata.gz: e05fe76281093c313880f5232f643049992b626f
4
+ data.tar.gz: ac8eea178154085b15e0dc3c3b1ad0f9519969c2
5
5
  SHA512:
6
- metadata.gz: 686d18f59e1a9c7b94b3fde55358717bee6011472ac80ea9b9083c78b26a9052c9a155811ed9e3d80a9144cb2c463cd04b265d0caf83bd4867f6077c01b70807
7
- data.tar.gz: 12ef6789757b9ba60082fe72a81b9e94fa315ce60cd352cf98d6d90dd292ca1fd439810460c77a7a381811fa805412370235c21e4668f977af35f66a64afca0c
6
+ metadata.gz: 2a85bcf4967a30e07556d261c07a88dfec8b4e0c8e0319a7cb60ace722107721083ef3688869e659b2f324e85e2b5d3ed96ed1a7e56cdc83707edd2afe3c8631
7
+ data.tar.gz: 44fb963f028c4225e79e8adf298f70bee75dc424244e1f9a6465f226b6c34e215b2bd03353a5dabadc0294d0dbbf9b4ae0a81a8f37dac8d86f3124445946113e
@@ -1,111 +1,120 @@
1
1
  require "rumination/deploy"
2
2
 
3
- task :deploy => "deploy:default"
4
-
5
- namespace :deploy do
6
- task :default => %w[
7
- start
8
- finish
9
- ]
10
-
11
- task :bootstrap => %w[
12
- start
13
- bootstrap:check_flag
14
- bootstrap:env_file
15
- bootstrap:copy_files
16
- bootstrap:db
17
- on:bootstrapped
18
- finish
19
- bootstrap:flag_success
20
- ]
21
-
22
- namespace :on do
23
- task :deployed
24
- task :bootstrapped
25
- end
26
-
27
- namespace :bootstrap do
28
- task :env_file do
29
- env_file_path = "/opt/app/env"
30
- temp_file_path = "tmp/#{Rumination::Deploy.target}.env"
31
- mkdir_p File.dirname(temp_file_path)
32
- Rumination::Deploy.write_env_file(temp_file_path)
33
- container = Rumination::Deploy.app_container_full_name
34
- sh "docker cp #{temp_file_path} #{container}:#{env_file_path}"
3
+ module DeployTasks
4
+ extend Rake::DSL
5
+
6
+ task :deploy => "deploy:default"
7
+
8
+ namespace :deploy do
9
+ task :default => %w[
10
+ start
11
+ finish
12
+ ]
13
+
14
+ task :bootstrap => %w[
15
+ start
16
+ bootstrap:check_flag
17
+ bootstrap:env_file
18
+ bootstrap:copy_files
19
+ bootstrap:db
20
+ on:bootstrapped
21
+ finish
22
+ bootstrap:flag_success
23
+ ]
24
+
25
+ namespace :on do
26
+ task :deployed
27
+ task :bootstrapped
35
28
  end
36
29
 
37
- task :copy_files do
38
- container = Rumination::Deploy.app_container_full_name
39
- Rumination::Deploy.files_to_copy_on_bootstrap.each do |source, target|
40
- sh "docker cp #{source} #{container}:#{target}"
30
+ namespace :bootstrap do
31
+ task :env_file do
32
+ env_file_path = "/opt/app/env"
33
+ temp_file_path = "tmp/#{Rumination::Deploy.target}.env"
34
+ mkdir_p File.dirname(temp_file_path)
35
+ Rumination::Deploy.write_env_file(temp_file_path)
36
+ container = Rumination::Deploy.app_container_full_name
37
+ sh "docker cp #{temp_file_path} #{container}:#{env_file_path}"
41
38
  end
42
- end
43
39
 
44
- task :db
40
+ task :copy_files do
41
+ container = Rumination::Deploy.app_container_full_name
42
+ Rumination::Deploy.files_to_copy_on_bootstrap.each do |source, target|
43
+ sh "docker cp #{source} #{container}:#{target}"
44
+ end
45
+ end
45
46
 
46
- task :flag_success do
47
- container = Rumination::Deploy.app_container_name
48
- flag_path = Rumination::Deploy.bootstrapped_flag_path
49
- sh "docker-compose run --rm #{container} touch #{flag_path}"
50
- end
47
+ task :db
48
+
49
+ task :flag_success do
50
+ container = Rumination::Deploy.app_container_name
51
+ flag_path = Rumination::Deploy.bootstrapped_flag_path
52
+ sh "docker-compose run --rm #{container} touch #{flag_path}"
53
+ end
51
54
 
52
- task :check_flag do
53
- container = Rumination::Deploy.app_container_name
54
- flag_path = Rumination::Deploy.bootstrapped_flag_path
55
- sh "docker-compose run --rm #{container} test -f #{flag_path}" do |ok, err|
56
- if ok
57
- message = "The target '#{Rumination::Deploy.target}' was bootstrap already"
58
- raise Rumination::Deploy::BootstrappedAlready, message
55
+ task :check_flag do
56
+ container = Rumination::Deploy.app_container_name
57
+ flag_path = Rumination::Deploy.bootstrapped_flag_path
58
+ sh "docker-compose run --rm #{container} test -f #{flag_path}" do |ok, err|
59
+ if ok
60
+ message = "The target '#{Rumination::Deploy.target}' was bootstrap already"
61
+ raise Rumination::Deploy::BootstrappedAlready, message
62
+ end
59
63
  end
60
64
  end
61
- end
62
65
 
63
- task :undo => %w[confirm_undo setup_docker_env] do
64
- sh "docker-compose down --remove-orphans -v"
65
- end
66
+ task :undo => %w[confirm_undo setup_docker_env] do
67
+ sh "docker-compose down --remove-orphans -v"
68
+ end
66
69
 
67
- task :confirm_undo do
68
- require "highline/import"
69
- question = "Do you really want to undo the bootstrap (database will be dropped)?"
70
- abort("Bootstrap undo canceled, you didn't mean it") unless agree(question)
70
+ task :confirm_undo do
71
+ require "highline/import"
72
+ question = "Do you really want to undo the bootstrap (database will be dropped)?"
73
+ abort("Bootstrap undo canceled, you didn't mean it") unless agree(question)
74
+ end
71
75
  end
72
- end
73
76
 
74
- task :start => %w[
75
- setup_docker_env
76
- switch_containers
77
- ]
77
+ task :start => %w[
78
+ setup_docker_env
79
+ switch_containers
80
+ ]
78
81
 
79
- task :finish => %w[
80
- copy_files
81
- on:deployed
82
- ]
82
+ task :finish => %w[
83
+ copy_files
84
+ on:deployed
85
+ ]
83
86
 
84
- task :switch_containers => %w[
85
- build_containers
86
- shut_down_services
87
- start_services
88
- ]
87
+ task :switch_containers => %w[
88
+ build_containers
89
+ shut_down_services
90
+ start_services
91
+ ]
89
92
 
90
- task :build_containers do
91
- sh "docker-compose build"
92
- end
93
+ task :build_containers do
94
+ sh "docker-compose build"
95
+ end
93
96
 
94
- task :shut_down_services do
95
- sh "docker-compose down --remove-orphans"
96
- end
97
+ task :shut_down_services do
98
+ sh "docker-compose down --remove-orphans"
99
+ end
97
100
 
98
- task :start_services do
99
- if Rumination::Deploy.development_target?
100
- sh "docker-compose run --rm #{container} bundle install"
101
+ task :start_services do
102
+ if Rumination::Deploy.development_target?
103
+ sh "docker-compose run --rm #{container} bundle install"
104
+ end
105
+ sh "docker-compose up -d"
101
106
  end
102
- sh "docker-compose up -d"
103
- end
104
107
 
105
- task :copy_files do
106
- container = Rumination::Deploy.app_container_full_name
107
- Rumination::Deploy.files_to_copy_on_deploy.each do |source, target|
108
- sh "docker cp #{source} #{container}:#{target}"
108
+ task :copy_files do
109
+ container = Rumination::Deploy.app_container_full_name
110
+ Rumination::Deploy.files_to_copy_on_deploy.each do |source, target|
111
+ sh "docker cp #{source} #{container}:#{target}"
112
+ end
109
113
  end
110
114
  end
115
+
116
+ def container
117
+ Rumination::Deploy.app_container_name
118
+ end
119
+
111
120
  end
@@ -1,3 +1,3 @@
1
1
  module Rumination
2
- VERSION = "0.14.4"
2
+ VERSION = "0.14.5"
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.14.4
4
+ version: 0.14.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Baguinski