rat_deployer 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rat_deployer/cli.rb +10 -26
- data/lib/rat_deployer/command.rb +2 -2
- data/lib/rat_deployer/config.rb +9 -0
- data/lib/rat_deployer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d123dc54c137abf9114ea06c8526d5e86ad5b21b
|
4
|
+
data.tar.gz: b820160c369e1a8292c71546e1023eeaea0f5331
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 670e760d635e7e5bf524d66e3836c5d7c66f92f16a12c948ed97539bea474518f86d564e7c6a2f7acb587a7aaa3236244c2fba4b79b58f2367d365640b748ad6
|
7
|
+
data.tar.gz: b9c47a75fcb09ffb82afeea6a8e134130585cf87a16f34265caa2fa7a8ef3d3e87f1501de9abb2da81aaead6afdd6d0a23292e16249a9bd769c8e8a2b6a22175
|
data/lib/rat_deployer/cli.rb
CHANGED
@@ -12,47 +12,31 @@ module RatDeployer
|
|
12
12
|
|
13
13
|
desc "deploy", "deploys current environment"
|
14
14
|
def deploy
|
15
|
-
unset_machine
|
16
15
|
run "rat images update"
|
17
|
-
|
18
|
-
|
19
|
-
run "rat compose pull"
|
20
|
-
run "rat compose up -d"
|
21
|
-
end
|
16
|
+
run "rat compose pull"
|
17
|
+
run "rat compose up -d"
|
22
18
|
end
|
23
19
|
|
24
20
|
desc "compose ARGS...", "runs docker-compose command with default flags"
|
25
21
|
def compose(cmd, *cmd_flags)
|
26
|
-
env
|
27
|
-
project_name
|
22
|
+
env = RatDeployer::Config.env
|
23
|
+
project_name = RatDeployer::Config.all.fetch('project_name')
|
28
24
|
|
29
25
|
flags = [
|
30
26
|
"-f config/default.yml",
|
31
27
|
"-f config/#{env}.yml",
|
32
28
|
"-p #{project_name}_#{env}"
|
33
|
-
]
|
34
|
-
|
35
|
-
within_machine do
|
36
|
-
run "docker-compose #{flags} #{cmd} #{cmd_flags.join(" ")}"
|
37
|
-
end
|
38
|
-
end
|
29
|
+
]
|
39
30
|
|
40
|
-
|
31
|
+
flags.unshift(remote_machine_flags) if RatDeployer::Config.remote
|
41
32
|
|
42
|
-
|
43
|
-
machine = RatDeployer::Config.for_env.fetch("machine")
|
44
|
-
run "eval $(docker-machine env #{machine})"
|
33
|
+
run "docker-compose #{flags.join(' ')} #{cmd} #{cmd_flags.join(" ")}"
|
45
34
|
end
|
46
35
|
|
47
|
-
|
48
|
-
run "eval $(docker-machine env --unset)"
|
49
|
-
end
|
36
|
+
private
|
50
37
|
|
51
|
-
def
|
52
|
-
|
53
|
-
yield
|
54
|
-
ensure
|
55
|
-
unset_machine
|
38
|
+
def remote_machine_flags
|
39
|
+
`docker-machine config #{RatDeployer::Config.machine}`.gsub(/\n/, ' ')
|
56
40
|
end
|
57
41
|
|
58
42
|
#def warn_if_running_on_remote_host
|
data/lib/rat_deployer/command.rb
CHANGED
@@ -9,7 +9,7 @@ module RatDeployer
|
|
9
9
|
puts msg
|
10
10
|
end
|
11
11
|
|
12
|
-
system
|
12
|
+
exit 1 unless system(cmd)
|
13
13
|
end
|
14
14
|
|
15
15
|
def put_heading(str)
|
@@ -48,7 +48,7 @@ module RatDeployer
|
|
48
48
|
end
|
49
49
|
|
50
50
|
private
|
51
|
-
|
51
|
+
|
52
52
|
def prompt_enabled?
|
53
53
|
ENV['RAT_PROMPT'] != "false"
|
54
54
|
end
|
data/lib/rat_deployer/config.rb
CHANGED
@@ -24,5 +24,14 @@ module RatDeployer
|
|
24
24
|
env_conf = environmental.fetch(e)
|
25
25
|
default_conf.deep_merge(env_conf)
|
26
26
|
end
|
27
|
+
|
28
|
+
def self.machine
|
29
|
+
for_env.fetch("machine")
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.remote
|
33
|
+
env_var = ENV['RAT_REMOTE']
|
34
|
+
env_var.nil? ? true : env_var == 'true'
|
35
|
+
end
|
27
36
|
end
|
28
37
|
end
|
data/lib/rat_deployer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rat_deployer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Oga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|