Skip to content

Commit

Permalink
Merge pull request #27 from munkiserver/phaus-master
Browse files Browse the repository at this point in the history
updating setup for automated installation
  • Loading branch information
rickychilcott committed Dec 28, 2017
2 parents 28ce4e6 + a859102 commit 9c4cc2d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/tasks/bootstrap.rake
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ namespace :bootstrap do
u = User.new(username: "root", email: "root@localhost.local")

# Ask for password/password_confirmation and hide the characters
password = nil
password_confirmation = nil
password = ENV['ROOTPASS']
password_confirmation = ENV['ROOTPASS']
console = HighLine.new
until password.present? && password == password_confirmation
password = console.ask("Enter your password: ") { |q| q.echo = false }
Expand All @@ -215,11 +215,14 @@ namespace :bootstrap do
desc "Create a settings.yaml file, if missing"
task :settings, [:settings, :hostname] => :environment do |_t, args|
unless File.exist?("config/settings.yaml")
hostname = args.hostame
puts "Grenerating settings.yaml file, if blank default to \"localhost:3000\""
print "Hostname: "
hostname = STDIN.gets.chomp

hostname = args.hostname if hostname.empty?
hostname = ENV['HOSTNAME'] if hostname.empty?
hostname = STDIN.gets.chomp if hostname.empty?
hostname = "localhost:3000" if hostname.empty?
print "Hostname: #{hostname}"

h = {}
File.open("config/settings.yaml", "w") do |file|
h[:action_mailer] = { host: hostname.to_s }
Expand Down

0 comments on commit 9c4cc2d

Please sign in to comment.