Return-Path: Delivered-To: apmail-incubator-deltacloud-commits-archive@minotaur.apache.org Received: (qmail 28760 invoked from network); 8 Jul 2010 23:42:52 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Jul 2010 23:42:52 -0000 Received: (qmail 82502 invoked by uid 500); 8 Jul 2010 23:42:51 -0000 Delivered-To: apmail-incubator-deltacloud-commits-archive@incubator.apache.org Received: (qmail 82453 invoked by uid 500); 8 Jul 2010 23:42:51 -0000 Mailing-List: contact deltacloud-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltacloud-dev@incubator.apache.org Delivered-To: mailing list deltacloud-commits@incubator.apache.org Received: (qmail 82349 invoked by uid 99); 8 Jul 2010 23:42:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jul 2010 23:42:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Jul 2010 23:42:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0399D2388A3B; Thu, 8 Jul 2010 23:41:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r962263 - /incubator/deltacloud/trunk/server/Rakefile Date: Thu, 08 Jul 2010 23:41:55 -0000 To: deltacloud-commits@incubator.apache.org From: lutter@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100708234156.0399D2388A3B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: lutter Date: Thu Jul 8 23:41:55 2010 New Revision: 962263 URL: http://svn.apache.org/viewvc?rev=962263&view=rev Log: Added install and uninstall tasks into server Modified: incubator/deltacloud/trunk/server/Rakefile Modified: incubator/deltacloud/trunk/server/Rakefile URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/Rakefile?rev=962263&r1=962262&r2=962263&view=diff ============================================================================== --- incubator/deltacloud/trunk/server/Rakefile (original) +++ incubator/deltacloud/trunk/server/Rakefile Thu Jul 8 23:41:55 2010 @@ -37,7 +37,6 @@ Rake::TestTask.new("test") { |t| t.warning = false } - Cucumber::Rake::Task.new(:features) do |t| t.cucumber_opts = "features --format html --out tmp/cucumber.html" t.rcov = false @@ -48,3 +47,46 @@ Cucumber::Rake::Task.new(:rcov) do |t| t.rcov = true t.rcov_opts << %[-o "tmp/coverage"] end + +desc "Install API" +task :install, [:install_dir, :bin_dir] do |t, args| + + require 'fileutils' + require 'pp' + + files = FileList[ + Dir["config/**/**"], + Dir["features/**/**"], + Dir["lib/**/**"], + Dir["public/**/**"], + Dir["views/**/**"], + "config.ru", + "COPYING", + "README", + "*.rb" + ] + + INSTALL_DIR=args.install_dir || "/usr/local/share/deltacloud-core" + BIN_DIR=args.bin_dir || "/usr/local/bin" + + exit(1) unless FileUtils.mkdir_p(INSTALL_DIR) + exit(1) unless FileUtils.mkdir_p(BIN_DIR) + + files.each do |f| + install_path = "#{INSTALL_DIR}/#{File.dirname(f)}" + unless File.directory?(install_path) + FileUtils.mkdir_p(install_path, :mode => 0755, :verbose => true) + end + next if File.directory?(f) + FileUtils.install(f, "#{INSTALL_DIR}/#{File.dirname(f)}", :verbose => true) + end + + FileUtils.install('bin/deltacloudd', BIN_DIR, :verbose => true, :mode => 0755) +end + +desc "Uninstall API" +task :uninstall do + require 'fileutils' + INSTALL_DIR="/usr/share/deltacloud-core" + FileUtils.rm_rf(INSTALL_DIR) +end