Module: KStrano::Play

Defined in:
lib/kstrano_play.rb

Class Method Summary collapse

Class Method Details

.load_into(configuration) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/kstrano_play.rb', line 5

def self.load_into(configuration)
  configuration.load do

    load_paths.push File.expand_path('../', __FILE__)
    load 'kstrano'

    namespace :deploy do
      desc "Updates latest release source path"
  task :finalize_update, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo} chmod -R g+w #{latest_release}" if fetch(:group_writable, true)
    run "#{try_sudo} chmod u+rx #{latest_release}/start.sh"
    run "#{try_sudo} chmod u+rx #{latest_release}/stop.sh"

    kuma::share_childs

    play::package
  end
    end

    namespace :play do
      desc "Build the app"
    task :package do
      try_sudo "bash -c 'PATH=$PATH:/home/projects/#{application}/play/default:. && cd #{latest_release} && play clean compile stage'"
    end

    desc "Start the server"
    task :start do
      try_sudo "bash -ic 'cd #{current_path} && PLAY_ENV=#{env} ./start.sh'"
    end

    desc "Stop the server"
    task :stop do
      try_sudo "bash -c 'cd #{current_path} && ./stop.sh'"
    end
end

after "deploy", "play:stop", "play:start"

      end
end