escualo 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/commands/script.rb +3 -11
 - data/lib/escualo/bootstrap.rb +2 -2
 - data/lib/escualo/script.rb +11 -0
 - data/lib/escualo/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: bd24960afca58b87794380c99c0482f885d4d2a9
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 6ffbeeb83d025654a463bdbe3cc1fc120d538d01
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 0cc553efd833313068883ff160cf60299db9fd1c3830246421258f010a76535ff58801fa2ef1eda153f3c59282ffea96eb8d67ce2ad93f5fca086b0c1c82daec
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: c38e7217aff732c52ced5f67801fb6309e91a0763354b979679d12d3195a1c797b1d507324b51526d9520ededac8118c3ed6fd2af6ca8a55ad6a52a5e4564fca
         
     | 
    
        data/lib/commands/script.rb
    CHANGED
    
    | 
         @@ -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'],  
     | 
| 
      
 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'],  
     | 
| 
      
 27 
     | 
    
         
            +
                  run_commands_for! file['deploy'], delegated_options, local_ssh, options
         
     | 
| 
       36 
28 
     | 
    
         
             
                end
         
     | 
| 
       37 
29 
     | 
    
         
             
              end
         
     | 
| 
       38 
30 
     | 
    
         
             
            end
         
     | 
    
        data/lib/escualo/bootstrap.rb
    CHANGED
    
    | 
         @@ -67,7 +67,7 @@ module Escualo 
     | 
|
| 
       67 
67 
     | 
    
         
             
                end
         
     | 
| 
       68 
68 
     | 
    
         | 
| 
       69 
69 
     | 
    
         
             
                def self.install_gems(ssh, options)
         
     | 
| 
       70 
     | 
    
         
            -
                  ssh.shell.perform!  
     | 
| 
      
 70 
     | 
    
         
            +
                  ssh.shell.perform! 'gem install bundler && gem install escualo', options
         
     | 
| 
       71 
71 
     | 
    
         
             
                end
         
     | 
| 
       72 
72 
     | 
    
         
             
              end
         
     | 
| 
       73 
     | 
    
         
            -
            end
         
     | 
| 
      
 73 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/escualo/script.rb
    CHANGED
    
    | 
         @@ -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 
     | 
    
         | 
    
        data/lib/escualo/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2016-12-05 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: commander
         
     |