escualo 0.2.12 → 0.3.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: 4d810cfadeace91fa3da01f727262afd51728784
4
- data.tar.gz: 1727137e9e977b53214a53128d8ce52d84df0863
3
+ metadata.gz: d93e2ffee46b1ffcb014f4051fffa207a496534c
4
+ data.tar.gz: 35e3379e10b51444dc50955b7f53e0c994ecf179
5
5
  SHA512:
6
- metadata.gz: 4d98cc07e4cd95335dcf1cf100dbd1184d95d7e73a72b8a9d15a979a0639372fdff8f6c9612ed39f170749ab5ced9894c8714887081e50b9168d0752201a76ed
7
- data.tar.gz: 552dc4329fd55dee90c67e22a9d45184dd528a04c9c8c1d0ba851a09b5f441ab67d30965b141fe750e1715b5f592bea716ae7d8ce314fb470ee770770e898390
6
+ metadata.gz: f783d45a44dff3f86a903ce7e79304995589b597d437195d2b2b58c5bc3b8bab409275d5c80494aa5f45413d6ddd680ad930260150942a0431e7c8cb74aa19bc
7
+ data.tar.gz: c46b22123a40942bfbaacc46319fefa6f8f0f8b138d6fb3f3df909e8b711d79185501c81ba2098a5a7a75e88ab47c47dd915189ee643c24a6c2813c74a451eb1
@@ -4,6 +4,9 @@ command 'bootstrap' do |c|
4
4
  c.option '--swap', TrueClass, 'Setup swap?'
5
5
  c.option '--monit-version VERSION', String, 'Monit version'
6
6
  c.option '--monit-password PASSWORD', String, 'Monit password. Will be prompted otherwise'
7
+ c.option '--no-monit', TrueClass, 'Skip monit installation'
8
+ c.option '--with-rbenv', TrueClass, 'Use rbenv instead of native ruby installation'
9
+
7
10
  c.option '-f', '--force', TrueClass, 'Force bootstrap even if already done?'
8
11
 
9
12
  c.ssh_action do |_args, options, ssh|
@@ -23,11 +26,12 @@ command 'bootstrap' do |c|
23
26
 
24
27
  step 'Installing base software...' do
25
28
  Escualo::Bootstrap.install_base ssh, options
29
+ Escualo::Bootstrap.install_ruby ssh, options
26
30
  end
27
31
 
28
32
  step 'Installing and configuring monit...' do
29
33
  Escualo::Bootstrap.setup_monit ssh, options
30
- end
34
+ end unless options.no_monit
31
35
 
32
36
  step 'Enabling swap...' do
33
37
  Escualo::Bootstrap.enable_swap ssh
@@ -1,5 +1,5 @@
1
1
  def run_commands_for!(script, extra='', ssh, options)
2
- script.map { |it| "escualo #{it} #{extra}" }.each do |command|
2
+ Escualo::Script.each_command script, extra do |command|
3
3
  puts "Running `#{command}`"
4
4
  ssh.shell.perform! command, options
5
5
  end
@@ -12,6 +12,7 @@ require_relative './ssh'
12
12
  require_relative './escualo/version'
13
13
  require_relative './escualo/env'
14
14
  require_relative './escualo/bootstrap'
15
+ require_relative './escualo/script'
15
16
  require_relative './escualo/plugin'
16
17
  require_relative './escualo/remote'
17
18
  require_relative './escualo/artifact'
@@ -16,14 +16,28 @@ module Escualo
16
16
  git \
17
17
  monit \
18
18
  libssl-dev \
19
- ruby2.0 \
20
- ruby2.0-dev \
21
19
  zlib1g \
22
20
  zlib1g-dev \
23
21
  libreadline-dev
24
22
  }, options
25
23
  end
26
24
 
25
+ def self.install_ruby(ssh, options)
26
+ if options.with_rbenv
27
+ ssh.shell.perform! %q{
28
+ curl https://raw.githubusercontent.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
29
+ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
30
+ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
31
+ }
32
+ else
33
+ ssh.shell.perform! %q{
34
+ apt-get install -y \
35
+ ruby2.0 \
36
+ ruby2.0-dev
37
+ }, options
38
+ end
39
+ end
40
+
27
41
  def self.enable_swap(ssh)
28
42
  ssh.exec! %q{ \
29
43
  test -e /swapfile ||
@@ -0,0 +1,8 @@
1
+ module Escualo
2
+ module Script
3
+ def self.each_command(script, extra='', &block)
4
+ script.map { |it| "escualo #{it} #{extra}" }.each(&block) if script
5
+ end
6
+ end
7
+ end
8
+
@@ -1,4 +1,4 @@
1
1
  module Escualo
2
- VERSION = '0.2.12'
2
+ VERSION = '0.3.0'
3
3
  BASE_VERSION = '3.1'
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.2.12
4
+ version: 0.3.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: 2016-11-09 00:00:00.000000000 Z
11
+ date: 2016-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -143,6 +143,7 @@ files:
143
143
  - lib/escualo/plugin/postgre.rb
144
144
  - lib/escualo/plugin/rabbit.rb
145
145
  - lib/escualo/remote.rb
146
+ - lib/escualo/script.rb
146
147
  - lib/escualo/version.rb
147
148
  - lib/ssh.rb
148
149
  - lib/ssh/local_session.rb