|
|
@ -2,9 +2,10 @@ |
|
|
|
|
|
|
|
|
|
|
|
require 'yaml' |
|
|
|
require 'yaml' |
|
|
|
|
|
|
|
|
|
|
|
def abort_installation |
|
|
|
def abort_installation! |
|
|
|
p "Something went wrong :(" |
|
|
|
p "Something went wrong :(" |
|
|
|
p "Installation aborted." |
|
|
|
p "Installation aborted." |
|
|
|
|
|
|
|
return false |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def check_ruby_version |
|
|
|
def check_ruby_version |
|
|
@ -49,7 +50,7 @@ def check_git |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def check_for_db_yaml |
|
|
|
def check_for_db_yaml |
|
|
|
unless File.exists?(Dir.pwd + '/config/database.yml') |
|
|
|
unless File.exists?(ROOT + '/config/database.yml') |
|
|
|
p "Please configure your database before installing openProject." |
|
|
|
p "Please configure your database before installing openProject." |
|
|
|
p "Create and configure config/database.yml to do that." |
|
|
|
p "Create and configure config/database.yml to do that." |
|
|
|
return false |
|
|
|
return false |
|
|
@ -108,8 +109,8 @@ def setup_openproject |
|
|
|
p "Creating database" |
|
|
|
p "Creating database" |
|
|
|
`rake db:create` |
|
|
|
`rake db:create` |
|
|
|
|
|
|
|
|
|
|
|
p "Migrating database" |
|
|
|
migrate_core |
|
|
|
`rake db:migrate` |
|
|
|
migrate_plugins |
|
|
|
else |
|
|
|
else |
|
|
|
return false |
|
|
|
return false |
|
|
|
end |
|
|
|
end |
|
|
@ -118,29 +119,40 @@ def setup_openproject |
|
|
|
system("rake generate_session_store") |
|
|
|
system("rake generate_session_store") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def bundle_default_plugins |
|
|
|
|
|
|
|
unless system("bundle install --without rmagick") |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def migrate_plugins |
|
|
|
def migrate_plugins |
|
|
|
p "Migrate Plugins" |
|
|
|
p "Migrate Plugins" |
|
|
|
system("rake db:migrate:plugins") |
|
|
|
system("rake db:migrate:plugins") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def migrate_core |
|
|
|
|
|
|
|
p "Migrate Core" |
|
|
|
|
|
|
|
`rake db:migrate` |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def install |
|
|
|
def install |
|
|
|
p 'Installing openProject...' |
|
|
|
p 'Installing openProject...' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
check_ruby_version |
|
|
|
check_ruby_version |
|
|
|
if not check_bundler or |
|
|
|
if not check_bundler or not check_git |
|
|
|
not check_git or not |
|
|
|
abort_installation! |
|
|
|
setup_openproject |
|
|
|
|
|
|
|
abort_installation |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
unless checkout_default_plugins |
|
|
|
unless checkout_default_plugins |
|
|
|
return false |
|
|
|
abort_installation! |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
migrate_plugins |
|
|
|
Dir.chdir ROOT |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return abort_installation! unless setup_openproject |
|
|
|
p "Installation Succeeded" |
|
|
|
p "Installation Succeeded" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ROOT = Dir.pwd |
|
|
|
install |
|
|
|
install |
|
|
|