deplomat 0.2.2 → 0.2.3

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
  SHA256:
3
- metadata.gz: b1212b6229789701a4ebfe5516275d834a4d663f3c1b9dec0b8507424e56ec81
4
- data.tar.gz: 423db49d5da2a756ffc0373d2c25653a6c630771c6c9ce104e0d5d7efd09575d
3
+ metadata.gz: 649b3f9699ee29575c54d2f18157ce94c4444a01dfc51fdd102b345e68a4df18
4
+ data.tar.gz: a7a88b52bebdcb0301c766c29eec204262afde730b90b6d8c252336b8524b3df
5
5
  SHA512:
6
- metadata.gz: 4b77c5baafa58b6475cf92e65d429af7934b8bfb84f90df49831a7a46286b9f7fa1a8e5784aea9e89040cf1100f6519b2aa96e568d894b9b723051e8f47472bc
7
- data.tar.gz: a931ce930106b50e3198d9f34bd86e9aed478495def68bc30e205edd33250172663bf3ffab477d282420845b6449797fa9ad08b739ac28e9acf79cfd63e7c944
6
+ metadata.gz: aa55565a17b627bca067990cbaf9ecc20dc2ba5f8198dea1b38284c67b39b24b0769ce0da5a0ccf26a5e299c019b74cb3963a7072e178feb51d573aa3fa2fafd
7
+ data.tar.gz: adb1de1f49dfe747fb152d1117952f7e5e5b6b3f6e3013ddc464c0c68e26dfa9e93a6e1cf737da31f2e03b8725ac55011a06f64526c71f95ba089137805b258d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
data/deplomat.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: deplomat 0.2.2 ruby lib
5
+ # stub: deplomat 0.2.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "deplomat".freeze
9
- s.version = "0.2.2"
9
+ s.version = "0.2.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
data/lib/deplomat/node.rb CHANGED
@@ -9,8 +9,7 @@ module Deplomat
9
9
  @log_to = log_to
10
10
  @logfile = logfile
11
11
  @raise_exceptions = raise_exceptions
12
- @current_path = path
13
- self.cd(path) if path
12
+ @current_path = path if path_exist?(path)
14
13
  end
15
14
 
16
15
  def execute(command, path=@current_path, message: [], stdout_source: :stdout, log_command: true, _raise_exceptions: @raise_exceptions)
@@ -131,6 +130,7 @@ module Deplomat
131
130
  if n <= current_number
132
131
  log "New requisite number (#{n}) is below or equals the current one (#{current_number}). " +
133
132
  "Something must have gone wrong.", color: "red"
133
+ self.close if self.respond_to?(:close)
134
134
  exit 1
135
135
  else
136
136
  File.open(counter_file_path, "w") { |f| f.puts n }
@@ -143,6 +143,7 @@ module Deplomat
143
143
  else
144
144
  log "Requisite counter file `#{fn}` doesn't exist. " +
145
145
  "Please create it manually and symlink it in the deployment script if necessary.", color: "red"
146
+ self.close if self.respond_to?(:close)
146
147
  exit 1
147
148
  end
148
149
  end
@@ -1,8 +1,10 @@
1
1
  module Deplomat
2
2
  class RemoteNode < Node
3
3
 
4
- def initialize(host:, port: 22, user: "deploy", raise_exceptions: true, path: nil)
5
- super(logfile: '~/deplomat.log', path: path, raise_exceptions: raise_exceptions)
4
+ def initialize(host:, port: 22, user: "deploy", raise_exceptions: true, path: nil, logfile: '~/deplomat.log', log_to: [:stdout])
5
+
6
+ @log_to = log_to
7
+ @logfile = logfile
6
8
 
7
9
  # Create ControlMasters dir, user might not have it
8
10
  unless File.exists?("#{ENV['HOME']}/.ssh/controlmasters/")
@@ -36,13 +38,15 @@ module Deplomat
36
38
  @host = host
37
39
  @user = user
38
40
  @port = port
41
+
42
+ super(logfile: '~/deplomat.log', path: path, raise_exceptions: raise_exceptions)
39
43
  end
40
44
 
41
45
  alias :local_execute :execute
42
46
  def execute(command, path=@current_path, message: [], env_vars: '', login_shell: false, stdout_source: :stdout, log_command: true, _raise_exceptions: @raise_exceptions)
43
47
 
44
48
  log("(#{@host}) --> " + command + "\n", color: "white") if log_command
45
- command = "#{env_vars} cd #{path} && #{command}" if path
49
+ command = "#{env_vars} cd #{path} && #{command}" if path
46
50
  command = "bash -l -c \"#{command}\"" if login_shell
47
51
  super("#{@ssh_command} '#{command}'", nil, message: message, stdout_source: stdout_source, log_command: false, _raise_exceptions: _raise_exceptions)
48
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deplomat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Snitko