rumination 0.11.5 → 0.12.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4db8607f09b3ee1aad402996f7f7d5b3e593fdf4
|
4
|
+
data.tar.gz: f10beea4befeb1b90ce0d5e52e57ff575a9cccdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0465ac699012527ca0cb92e0e6165cb63353d81c74281f7b42136095154379d50ebe6c5697ce00fbd72dfbe5e182cbe827169bed62d697c5b31f8f1606fa4ee
|
7
|
+
data.tar.gz: f497f85837a48dee0c8dd20c797bb8152f959d194c60a7f0b5a53bc6e7a63c428d1de08d04c2c0f0133f142f3863d55a4753e35f5bef9458887614685c61b825
|
data/lib/rumination/deploy.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "active_support/configurable"
|
2
2
|
require_relative "deploy/class_methods"
|
3
|
+
require "dotenv/parser"
|
3
4
|
|
4
5
|
module Rumination
|
5
6
|
module Deploy
|
@@ -10,5 +11,20 @@ module Rumination
|
|
10
11
|
BootstrapError = Class.new(DeployError)
|
11
12
|
BootstrappedAlready = Class.new(BootstrapError)
|
12
13
|
DatabaseInitError = Class.new(BootstrapError)
|
14
|
+
|
15
|
+
def docker_env
|
16
|
+
env = {}
|
17
|
+
if config.docker_machine
|
18
|
+
dm_env_str = `docker-machine env #{config.docker_machine}`
|
19
|
+
env = env.merge(Dotenv::Parser.call(dm_env_str))
|
20
|
+
end
|
21
|
+
env["COMPOSE_FILE"] = config.compose_file if config.compose_file
|
22
|
+
env["VIRTUAL_HOST"] = config.virtual_host
|
23
|
+
if config.letsencrypt_email.present?
|
24
|
+
env["LETSENCRYPT_HOST"] = config.virtual_host
|
25
|
+
env["LETSENCRYPT_EMAIL"] = config.letsencrypt_email
|
26
|
+
end
|
27
|
+
env
|
28
|
+
end
|
13
29
|
end
|
14
30
|
end
|
@@ -1,5 +1,39 @@
|
|
1
|
-
task :deploy, [:target]
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
task :deploy, [:target] => "deploy:default"
|
2
|
+
|
3
|
+
namespace :deploy do
|
4
|
+
task :env, [:target] => :load_target_config do |t, args|
|
5
|
+
Rumination::Deploy.docker_env.each do |var, val|
|
6
|
+
puts %Q[export #{var}="#{val}"]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
task :default, [:target] => :setup_docker_env do |t, args|
|
11
|
+
end
|
12
|
+
|
13
|
+
task :bootstrap, [:target] => :setup_docker_env do |t, args|
|
14
|
+
end
|
15
|
+
|
16
|
+
task :setup_docker_env, [:target] => :load_target_config do |t, args|
|
17
|
+
ENV.update Rumination::Deploy.docker_env
|
18
|
+
end
|
19
|
+
|
20
|
+
task :load_target_config, [:target] do |t, args|
|
21
|
+
args.with_defaults target: :development
|
22
|
+
begin
|
23
|
+
load target_config_path
|
24
|
+
rescue LoadError => e
|
25
|
+
raise RuntimeError, e.message
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
namespace :bootstrap do
|
30
|
+
task :undo, [:target] => %w[confirm_undo] do |t, args|
|
31
|
+
end
|
32
|
+
|
33
|
+
task :confirm_undo do |t, args|
|
34
|
+
require "highline/import"
|
35
|
+
question = "Do you really want to undo the bootstrap (database will be dropped)?"
|
36
|
+
abort("Bootstrap undo canceled, you didn't mean it") unless agree(question)
|
37
|
+
end
|
38
|
+
end
|
5
39
|
end
|
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.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Baguinski
|
@@ -157,8 +157,6 @@ files:
|
|
157
157
|
- lib/rumination/tasks/db/dump.rake
|
158
158
|
- lib/rumination/tasks/db/setup.rake
|
159
159
|
- lib/rumination/tasks/deploy.rake
|
160
|
-
- lib/rumination/tasks/deploy/bootstrap.rake
|
161
|
-
- lib/rumination/tasks/deploy/env.rake
|
162
160
|
- lib/rumination/tasks/deploy/inside.rake
|
163
161
|
- lib/rumination/version.rb
|
164
162
|
- rumination.gemspec
|
@@ -1,27 +0,0 @@
|
|
1
|
-
namespace :deploy do
|
2
|
-
task :bootstrap, [:target] do |t, args|
|
3
|
-
require "rumination/deploy"
|
4
|
-
args.with_defaults target: :development
|
5
|
-
begin
|
6
|
-
Rumination::Deploy.bootstrap(target: args.target)
|
7
|
-
rescue Rumination::Deploy::BootstrappedAlready
|
8
|
-
abort "'#{args.target}' has already been bootstrapped"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
namespace :bootstrap do
|
13
|
-
task :undo, [:target] => %w[confirm_undo start_undo] do |t, args|
|
14
|
-
require "rumination/deploy"
|
15
|
-
args.with_defaults target: :development
|
16
|
-
Rumination::Deploy.bootstrap_undo(target: args.target)
|
17
|
-
end
|
18
|
-
|
19
|
-
task :confirm_undo do |t, args|
|
20
|
-
require "highline/import"
|
21
|
-
question = "Do you really want to undo the bootstrap (database will be dropped)?"
|
22
|
-
abort("Bootstrap undo canceled, you didn't mean it") unless agree(question)
|
23
|
-
end
|
24
|
-
|
25
|
-
task :start_undo, [:target]
|
26
|
-
end
|
27
|
-
end
|