rumination 0.13.7 → 0.14
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/tasks/deploy/env.rake +37 -0
- data/lib/rumination/tasks/deploy.rake +6 -43
- data/lib/rumination/version.rb +1 -1
- metadata +3 -3
- data/lib/rumination/tasks/deploy/inside.rake +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a93cd5828bc697497ee31a4a7260bad0fa38a38
|
4
|
+
data.tar.gz: e7c055fb32f02dd425f78a88b8ecb36c401310f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b9ea7893c7ed39fc6ca37317a1508c26ebe458eb91f4947eb786e88a5248c657ab7d509dc3c5be554ddb760d259cb319fad6914c31de37fed6e7c59e518acb6
|
7
|
+
data.tar.gz: c19592bdf38a19e7b80c410eaa3cf44cff13307538e5f1cbef85680b707ada8946257f4bdc9a4547ac7a2101b669dc5257e3452deb2c797e4d9704781f0939d5
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "rumination/deploy"
|
2
|
+
require "dotenv"
|
3
|
+
require "active_support/core_ext/string/strip"
|
4
|
+
|
5
|
+
namespace :deploy do
|
6
|
+
task :env => :load_target_config_filterd do
|
7
|
+
puts
|
8
|
+
Rumination::Deploy.docker_env.each do |var, val|
|
9
|
+
puts %Q[export #{var}="#{val}"]
|
10
|
+
end
|
11
|
+
puts <<-__.strip_heredoc
|
12
|
+
# to load this into a bash environment run:
|
13
|
+
#
|
14
|
+
# eval "$(rake deploy:env[#{Rumination::Deploy.target}])"
|
15
|
+
#
|
16
|
+
# Quotes aren't optional
|
17
|
+
__
|
18
|
+
end
|
19
|
+
|
20
|
+
task :load_target_config do
|
21
|
+
target = ENV["TARGET"] || "development"
|
22
|
+
puts "Loading '#{target}' target config"
|
23
|
+
Rumination::Deploy.load_target_config target
|
24
|
+
end
|
25
|
+
|
26
|
+
task :load_target_config_filterd do
|
27
|
+
with_hash_puts do
|
28
|
+
Rake::Task["deploy:load_target_config"].invoke
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
task :setup_docker_env => :load_target_config do
|
33
|
+
puts "Setting up '#{Rumination::Deploy.target}' target docker environment"
|
34
|
+
Dotenv.load
|
35
|
+
ENV.update Rumination::Deploy.docker_env
|
36
|
+
end
|
37
|
+
end
|
@@ -1,16 +1,14 @@
|
|
1
1
|
require "rumination/deploy"
|
2
|
-
require "dotenv"
|
3
|
-
require "active_support/core_ext/string/strip"
|
4
2
|
|
5
|
-
task :deploy
|
3
|
+
task :deploy => "deploy:default"
|
6
4
|
|
7
5
|
namespace :deploy do
|
8
|
-
task :default
|
6
|
+
task :default => %w[
|
9
7
|
start
|
10
8
|
finish
|
11
9
|
]
|
12
10
|
|
13
|
-
task :bootstrap
|
11
|
+
task :bootstrap => %w[
|
14
12
|
start
|
15
13
|
bootstrap:check_flag
|
16
14
|
bootstrap:env_file
|
@@ -21,20 +19,6 @@ namespace :deploy do
|
|
21
19
|
bootstrap:flag_success
|
22
20
|
]
|
23
21
|
|
24
|
-
task :env, [:target] => :load_target_config_filterd do |t, args|
|
25
|
-
puts
|
26
|
-
Rumination::Deploy.docker_env.each do |var, val|
|
27
|
-
puts %Q[export #{var}="#{val}"]
|
28
|
-
end
|
29
|
-
puts <<-__.strip_heredoc
|
30
|
-
# to load this into a bash environment run:
|
31
|
-
#
|
32
|
-
# eval "$(rake deploy:env[#{Rumination::Deploy.target}])"
|
33
|
-
#
|
34
|
-
# Quotes aren't optional
|
35
|
-
__
|
36
|
-
end
|
37
|
-
|
38
22
|
namespace :on do
|
39
23
|
task :deployed
|
40
24
|
task :bootstrapped
|
@@ -76,39 +60,18 @@ namespace :deploy do
|
|
76
60
|
end
|
77
61
|
end
|
78
62
|
|
79
|
-
task :undo
|
80
|
-
confirm_undo
|
81
|
-
setup_docker_env
|
82
|
-
] do |t, args|
|
63
|
+
task :undo => %w[confirm_undo setup_docker_env] do
|
83
64
|
sh "docker-compose down --remove-orphans -v"
|
84
65
|
end
|
85
66
|
|
86
|
-
task :confirm_undo do
|
67
|
+
task :confirm_undo do
|
87
68
|
require "highline/import"
|
88
69
|
question = "Do you really want to undo the bootstrap (database will be dropped)?"
|
89
70
|
abort("Bootstrap undo canceled, you didn't mean it") unless agree(question)
|
90
71
|
end
|
91
72
|
end
|
92
73
|
|
93
|
-
task :
|
94
|
-
puts "Setting up '#{Rumination::Deploy.target}' target docker environment"
|
95
|
-
Dotenv.load
|
96
|
-
ENV.update Rumination::Deploy.docker_env
|
97
|
-
end
|
98
|
-
|
99
|
-
task :load_target_config, [:target] do |t, args|
|
100
|
-
args.with_defaults target: :development
|
101
|
-
puts "Loading '#{args.target}' target config"
|
102
|
-
Rumination::Deploy.load_target_config args.target
|
103
|
-
end
|
104
|
-
|
105
|
-
task :load_target_config_filterd, [:target] do |t, args|
|
106
|
-
with_hash_puts do
|
107
|
-
Rake::Task["deploy:load_target_config"].invoke args.target
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
task :start, [:target] => %w[
|
74
|
+
task :start => %w[
|
112
75
|
setup_docker_env
|
113
76
|
switch_containers
|
114
77
|
]
|
data/lib/rumination/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rumination
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.14'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Baguinski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -154,7 +154,7 @@ files:
|
|
154
154
|
- lib/rumination/tasks/db/dump.rake
|
155
155
|
- lib/rumination/tasks/db/setup.rake
|
156
156
|
- lib/rumination/tasks/deploy.rake
|
157
|
-
- lib/rumination/tasks/deploy/
|
157
|
+
- lib/rumination/tasks/deploy/env.rake
|
158
158
|
- lib/rumination/tasks/with_hash_puts.rake
|
159
159
|
- lib/rumination/version.rb
|
160
160
|
- rumination.gemspec
|
@@ -1,48 +0,0 @@
|
|
1
|
-
namespace :deploy do
|
2
|
-
namespace :inside do
|
3
|
-
# these are invoked inside the containers
|
4
|
-
task :bootstrap, [:target] => %w[db:setup:maybe_load_dump]
|
5
|
-
|
6
|
-
namespace :bootstrap do
|
7
|
-
task :undo, [:target] => %w[db:drop remove_env_file]
|
8
|
-
|
9
|
-
task :remove_env_file, [:target] do |t, args|
|
10
|
-
Rumination::Deploy.rm_env_file(target: args.target)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
task :write_env_file, [:target] do |t, args|
|
15
|
-
require "rumination/deploy"
|
16
|
-
Rumination::Deploy.write_env_file(target: args.target)
|
17
|
-
end
|
18
|
-
|
19
|
-
task :unload, [:target] do |t, args|
|
20
|
-
vhost = ENV["VIRTUAL_HOST"]
|
21
|
-
if vhost.present?
|
22
|
-
sh "rm -f /etc/nginx/vhost.d/#{vhost}*"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
task :finish, [:target] => %w[static_files vhost_conf]
|
27
|
-
|
28
|
-
task :static_files, [:target] do |t, args|
|
29
|
-
vhost = ENV["VIRTUAL_HOST"]
|
30
|
-
if vhost
|
31
|
-
sh "rsync -av public/ /var/www/#{vhost}"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
task :vhost_conf, [:target] do |t, args|
|
36
|
-
def erb_config basename, vhost
|
37
|
-
template = "config/nginx/vhost.d/#{basename}.erb"
|
38
|
-
if vhost && File.exists?(template)
|
39
|
-
new_name = basename.sub("app", vhost)
|
40
|
-
sh "erb #{template} > /etc/nginx/vhost.d/#{new_name}"
|
41
|
-
end
|
42
|
-
end
|
43
|
-
vhost = ENV["VIRTUAL_HOST"]
|
44
|
-
erb_config "app", vhost
|
45
|
-
erb_config "app_location", vhost
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|