escualo 0.5.2 → 0.6.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: d5322dd31b4d98ae12f54ab2d2ffa396fda9b8e6
4
- data.tar.gz: e332f460abb9c54bf517cc6be73f7b700adfad56
3
+ metadata.gz: bd24960afca58b87794380c99c0482f885d4d2a9
4
+ data.tar.gz: 6ffbeeb83d025654a463bdbe3cc1fc120d538d01
5
5
  SHA512:
6
- metadata.gz: f6ae8b63746dd639017357831198cfc70aefee53d936d3db565f3603c75deca5126cf6c7c36b2c9bdb856ad3f648f99cb1bcb874e8dca675579ee8e87882d7e0
7
- data.tar.gz: c3236170f00afe556761a18bb7d87a9f982f6b6ee6e00b3ec5e81c68f0cf149158e8a1eb8776bb9e43b13b7cdd91735d1995bc41a96b017b7de8964e24946948
6
+ metadata.gz: 0cc553efd833313068883ff160cf60299db9fd1c3830246421258f010a76535ff58801fa2ef1eda153f3c59282ffea96eb8d67ce2ad93f5fca086b0c1c82daec
7
+ data.tar.gz: c38e7217aff732c52ced5f67801fb6309e91a0763354b979679d12d3195a1c797b1d507324b51526d9520ededac8118c3ed6fd2af6ca8a55ad6a52a5e4564fca
@@ -5,24 +5,16 @@ def run_commands_for!(script, extra='', ssh, options)
5
5
  end
6
6
  end
7
7
 
8
- def ssh_options
9
- [$hostname.try { |it| "--hostname #{it}" },
10
- $username.try { |it| "--username #{it}" },
11
- $password.try { |it| "--password #{it}" },
12
- $ssh_key.try { |it| "--ssh-key #{it}" },
13
- $ssh_port.try { |it| "--ssh-port #{it}" }
14
- ].compact.join(' ')
15
- end
16
-
17
8
  command 'script' do |c|
18
9
  c.syntax = 'escualo script <FILE>'
19
10
  c.description = 'Runs a escualo configuration'
20
11
  c.action do |args, options|
21
12
  file = YAML.load_file args.first
22
13
  local_ssh = Net::SSH::Connection::LocalSession.new
14
+ delegated_options = Escualo::Script.delegated_options options
23
15
 
24
16
  step 'Running local commands...' do
25
- run_commands_for! file['local'], ssh_options, local_ssh, options
17
+ run_commands_for! file['local'], delegated_options, local_ssh, options
26
18
  end
27
19
 
28
20
  step 'Running remote commands...' do
@@ -32,7 +24,7 @@ command 'script' do |c|
32
24
  end
33
25
 
34
26
  step 'Running deploy commands...' do
35
- run_commands_for! file['deploy'], ssh_options, local_ssh, options
27
+ run_commands_for! file['deploy'], delegated_options, local_ssh, options
36
28
  end
37
29
  end
38
30
  end
@@ -67,7 +67,7 @@ module Escualo
67
67
  end
68
68
 
69
69
  def self.install_gems(ssh, options)
70
- ssh.shell.perform! "gem install bundler && gem install escualo -v #{Escualo::VERSION}", options
70
+ ssh.shell.perform! 'gem install bundler && gem install escualo', options
71
71
  end
72
72
  end
73
- end
73
+ end
@@ -3,6 +3,17 @@ module Escualo
3
3
  def self.each_command(script, extra='', &block)
4
4
  script.map { |it| "escualo #{it} #{extra}" }.each(&block) if script
5
5
  end
6
+
7
+ def self.delegated_options(options)
8
+ [options.hostname.try { |it| "--hostname #{it}" },
9
+ options.username.try { |it| "--username #{it}" },
10
+ options.password.try { |it| "--password #{it}" },
11
+ options.ssh_key.try { |it| "--ssh-key #{it}" },
12
+ options.ssh_port.try { |it| "--ssh-port #{it}" },
13
+ options.trace && '--trace',
14
+ options.verbose && '--verbose'
15
+ ].compact.join(' ')
16
+ end
6
17
  end
7
18
  end
8
19
 
@@ -1,4 +1,4 @@
1
1
  module Escualo
2
- VERSION = '0.5.2'
2
+ VERSION = '0.6.0'
3
3
  BASE_VERSION = '3.2'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: escualo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-17 00:00:00.000000000 Z
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander