rat_deployer 0.1.8 → 0.1.9

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: 6fc1115312147c9e70bfaa521f4022d4bf27fa5b
4
- data.tar.gz: 61402f1585e6728af319719b58278261660743cd
3
+ metadata.gz: c4203c688b0c0a96a80491bb71471ff340b1ecab
4
+ data.tar.gz: 76e3a012273a7e43dd9c624d0d338c6a5ea6197c
5
5
  SHA512:
6
- metadata.gz: 96d026a5bbe98dabac1a8f648460a264bb7b3b4ed93efd853b30831b7867eac4d5fafb0e3fea96ad737d112322adbcb8ba791ede8012e983848f9cceb5e1685a
7
- data.tar.gz: 5f0c83a6e97cb5e8ef998de2abab712d8ef994732ce6a42d322dbbe89212b13a64918ec50640e7edac7776a11064cb47bf67b5532bbbde8f77a9af2a08a15a77
6
+ metadata.gz: 8308759584af000b150f42cbcc8f2aad476c575610717591a4ea20d47d88dc8d74687c608ca14ca279c31b13f2fc627be7917982fc088e77a67ac774c7f25bb8
7
+ data.tar.gz: 564eb2f823afcfb03b3799c028d3c362c7a25ed70af0f7d8ec428a42c3be4e5ed3d29c6ddc4273a440b877cd3d857260f7e016851d6ded913615fd0df3861e7b
@@ -19,7 +19,7 @@ module RatDeployer
19
19
 
20
20
  desc "compose ARGS...", "runs docker-compose command with default flags"
21
21
  def compose(cmd, *cmd_flags)
22
- env = RatDeployer::Config.env
22
+ etnv = RatDeployer::Config.env
23
23
  project_name = RatDeployer::Config.all.fetch('project_name')
24
24
 
25
25
  flags = [
@@ -28,7 +28,9 @@ module RatDeployer
28
28
  "-p #{project_name}_#{env}"
29
29
  ]
30
30
 
31
- flags.unshift(remote_machine_flags) if RatDeployer::Config.remote
31
+ if RatDeployer::Config.remote
32
+ flags.unshift(RatDeployer::Config.remote_machine_flags)
33
+ end
32
34
 
33
35
  run "docker-compose #{flags.join(' ')} #{cmd} #{cmd_flags.join(" ")}"
34
36
  end
@@ -39,22 +41,12 @@ module RatDeployer
39
41
  project_name = RatDeployer::Config.all.fetch('project_name')
40
42
 
41
43
  flags = []
42
- flags.unshift(remote_machine_flags) if RatDeployer::Config.remote
43
-
44
- run "docker #{flags.join(' ')} #{cmd} #{cmd_flags.join(" ")}"
45
- end
46
44
 
47
- private
45
+ if RatDeployer::Config.remote
46
+ flags.unshift(RatDeployer::Config.remote_machine_flags)
47
+ end
48
48
 
49
- def remote_machine_flags
50
- `docker-machine config #{RatDeployer::Config.machine}`.gsub(/\n/, ' ')
49
+ run "docker #{flags.join(' ')} #{cmd} #{cmd_flags.join(" ")}"
51
50
  end
52
-
53
- #def warn_if_running_on_remote_host
54
- #if machine = ENV["DOCKER_MACHINE"]
55
- #put_warning "Your docker client is pointing to the remote machine #{machine}"
56
- #ask_for_confirmation
57
- #end
58
- #end
59
51
  end
60
52
  end
@@ -25,6 +25,13 @@ module RatDeployer
25
25
  default_conf.deep_merge(env_conf)
26
26
  end
27
27
 
28
+ def self.prompt_enabled?
29
+ ENV['RAT_PROMPT'] != "false"
30
+ end
31
+
32
+ # Loads machine config for current env.
33
+ # Acceps either a docker-machine machine name
34
+ # or an object with keys ca_cert, cert, key, and host.
28
35
  def self.machine
29
36
  for_env.fetch("machine")
30
37
  end
@@ -34,8 +41,19 @@ module RatDeployer
34
41
  env_var.nil? ? true : env_var == 'true'
35
42
  end
36
43
 
37
- def self.prompt_enabled?
38
- ENV['RAT_PROMPT'] != "false"
44
+ def self.remote_machine_flags
45
+ case machine
46
+ when Symbol, String
47
+ `docker-machine config #{machine}`.gsub(/\n/, ' ')
48
+ when Hash
49
+ [
50
+ "--tlsverify",
51
+ "-H='#{machine.fetch('host')}'",
52
+ "--tlscacert='#{machine.fetch('ca_cert')}'",
53
+ "--tlscert='#{machine.fetch('cert')}'",
54
+ "--tlskey='#{machine.fetch('key')}'",
55
+ ].join(' ')
56
+ end
39
57
  end
40
58
  end
41
59
  end
@@ -1,3 +1,3 @@
1
1
  module RatDeployer
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
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.8
4
+ version: 0.1.9
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-12-26 00:00:00.000000000 Z
11
+ date: 2016-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor