escualo 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/commands/bootstrap.rb +10 -6
- data/lib/commands/env.rb +1 -1
- data/lib/escualo/bootstrap.rb +1 -1
- data/lib/escualo/env.rb +6 -6
- data/lib/escualo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3827d539f18c31abf1aaec81a89e06a42a70a58a
|
4
|
+
data.tar.gz: 02efc2c36af8bcffe6fc5be8400398c69daf0548
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6feadff99ff05b7df68ef80a2f243ec03aed1421faae87075fef2dda457297c9b4195fbfb3b6eef2eec57c1a87d53904436179a045855688e08b234458c3d648
|
7
|
+
data.tar.gz: 0ec8e3e187abeaa19e6707f3e2c5bfb7145d1813d0e737b6e88b09e654ff1fb7f2b6c59b1784d1f258d55b7fdf508111a7ac2ba1b742453b68e723e2d6391b79
|
data/lib/commands/bootstrap.rb
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
def ask_monit_password(options)
|
2
|
+
password = ask('Monit Password: ') { |q| q.echo = '*' }
|
3
|
+
options.default monit_password: password
|
4
|
+
end
|
5
|
+
|
1
6
|
command 'bootstrap' do |c|
|
2
7
|
c.syntax = 'escualo bootstrap'
|
3
8
|
c.description = 'Prepare environment to be an escualo host'
|
@@ -5,23 +10,22 @@ command 'bootstrap' do |c|
|
|
5
10
|
c.option '--monit-version VERSION', String, 'Monit version'
|
6
11
|
c.option '--monit-password PASSWORD', String, 'Monit password. Will be prompted otherwise'
|
7
12
|
c.option '--no-monit', TrueClass, 'Skip monit installation'
|
13
|
+
c.option '--env', String, 'Environment. Valid options are development and production. default is production'
|
8
14
|
c.option '--with-rbenv', TrueClass, 'Use rbenv instead of native ruby installation'
|
9
15
|
|
10
16
|
c.option '-f', '--force', TrueClass, 'Force bootstrap even if already done?'
|
11
17
|
|
12
18
|
c.ssh_action do |_args, options, ssh|
|
13
|
-
unless options.
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
-
options.default monit_version: '5.16'
|
19
|
+
ask_monit_password(options) unless options.monit_password || options.no_monit
|
20
|
+
options.default monit_version: '5.16',
|
21
|
+
environment: 'production'
|
18
22
|
|
19
23
|
do_unless Escualo::Env.present?(ssh, :ESCUALO_BASE_VERSION),
|
20
24
|
'This host has already been bootstrapped',
|
21
25
|
options do
|
22
26
|
step 'Configuring variables...' do
|
23
27
|
Escualo::Env.setup ssh
|
24
|
-
Escualo::Env.set_builtins ssh
|
28
|
+
Escualo::Env.set_builtins ssh, options
|
25
29
|
end
|
26
30
|
|
27
31
|
step 'Installing base software...' do
|
data/lib/commands/env.rb
CHANGED
data/lib/escualo/bootstrap.rb
CHANGED
data/lib/escualo/env.rb
CHANGED
@@ -10,19 +10,19 @@ module Escualo
|
|
10
10
|
}
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.set_builtins(ssh)
|
13
|
+
def self.set_builtins(ssh, options)
|
14
14
|
set ssh, ESCUALO_BASE_VERSION: Escualo::BASE_VERSION
|
15
15
|
set ssh, Escualo::Env.locale_variables
|
16
|
-
set ssh, Escualo::Env.
|
16
|
+
set ssh, Escualo::Env.environment_variables(options.environment)
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.list(ssh)
|
20
20
|
ssh.exec!("cat ~/.escualo/vars/*").gsub("export ", '')
|
21
21
|
end
|
22
22
|
|
23
|
-
def self.clean(ssh)
|
23
|
+
def self.clean(ssh, options)
|
24
24
|
ssh.exec!("rm ~/.escualo/vars/*")
|
25
|
-
set_builtins ssh
|
25
|
+
set_builtins ssh, options
|
26
26
|
end
|
27
27
|
|
28
28
|
def self.present?(ssh, variable)
|
@@ -52,9 +52,9 @@ module Escualo
|
|
52
52
|
end.to_h
|
53
53
|
end
|
54
54
|
|
55
|
-
def self.
|
55
|
+
def self.environment_variables(environment)
|
56
56
|
%w{RAILS_ENV NODE_ENV RACK_ENV}.map do |it|
|
57
|
-
[it,
|
57
|
+
[it, environment]
|
58
58
|
end.to_h
|
59
59
|
end
|
60
60
|
|
data/lib/escualo/version.rb
CHANGED