Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added play:setup task to download & install play via HTTP

  • Loading branch information...
commit 1012d118e2002a7989026941074f051fc59cedaf 1 parent dd018be
Yamashita Yuu authored
Showing with 41 additions and 0 deletions.
  1. +41 −0 conf/play-recipes.rb
41 conf/play-recipes.rb
View
@@ -43,6 +43,47 @@
end
namespace :play do
+ _cset :play_version, '1.2.4'
+ _cset :play_zip_url do
+ "http://download.playframework.org/releases/#{File.basename(play_zip_file)}"
+ end
+ _cset :play_zip_file do
+ File.join('/tmp', "play-#{play_version}.zip")
+ end
+ _cset :play_path do
+# File.join(shared_path, "play-#{play_version}")
+ abort "you must specify install path for play"
+ end
+ _cset :play_cmd do
+ File.join(play_path, 'play')
+ end
+ _cset :play_preserve_zip, true
+
+ namespace :setup do
+ desc "install play if needed"
+ task :default do
+ transaction {
+ install_play
+ }
+ end
+
+ task :install_play do
+ on_rollback {
+ files = [ play_path ]
+ files << play_zip_file unless play_preserve_zip
+ run "rm -rf #{files.join(' ')}"
+ }
+ run "rm -f #{play_zip_file}" unless play_preserve_zip
+ run <<-E
+ if ! test -d #{play_path}; then
+ (test -f #{play_zip_file} || wget --no-verbose -o #{play_zip_file} #{play_zip_url}; true) &&
+ unzip #{play_zip_file} -d #{File.dirname(play_path)} && test -x #{play_path}/play;
+ fi
+ E
+ run "rm -f #{play_zip_file}" unless play_preserve_zip
+ end
+ end
+
desc "view play pid"
task :pid do
run "cd #{app_path}; #{play_path}/play pid --pid_file=#{app_pid}"
Please sign in to comment.
Something went wrong with that request. Please try again.