Class: Rays::Worker::Deployer::EARDeploy

Inherits:
BaseWorker
  • Object
show all
Includes:
Singleton
Defined in:
lib/rays/workers/deployer.rb

Overview

EAR deployer

Instance Method Summary collapse

Methods inherited from BaseWorker

#execute, register

Instance Method Details

#deploy(app_module) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/rays/workers/deployer.rb', line 55

def deploy(app_module)
  execute('deploy', app_module) do
    env = $rays_config.environment
    file_to_deploy = File.expand_path("./ear/target/#{app_module.name}-#{Project.instance.version}.ear")
    file_to_deploy = File.expand_path("./ear/target/#{app_module.name}.ear") unless File.exists? file_to_deploy
    if env.liferay.remote?
      env.liferay.remote.copy_to(file_to_deploy, env.liferay.service.deploy)
    else
      FileUtils.cp(file_to_deploy, env.liferay.service.deploy)
    end
  end
end