Skip to content

Commit

Permalink
CI now downloads jetty instead of using a submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Feb 27, 2013
1 parent 74b7d8b commit fc80de0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ load "lib/tasks/active_fedora_dev.rake" if defined?(Rake)

CLEAN.include %w[**/.DS_Store tmp *.log *.orig *.tmp **/*~]

task :ci => ['jetty:clean', 'active_fedora:ci']
task :spec => ['active_fedora:rspec']
task :rcov => ['active_fedora:rcov']


task :default => [:spec]
task :default => [:ci]
43 changes: 33 additions & 10 deletions lib/tasks/active_fedora_dev.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@ APP_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../")

require 'jettywrapper'

namespace :jetty do
JETTY_URL = 'https://github.com/projecthydra/hydra-jetty/archive/new-solr-schema.zip'
JETTY_ZIP = File.join 'tmp', JETTY_URL.split('/').last
JETTY_DIR = 'jetty'

desc "download the jetty zip file"
task :download do
puts "Downloading jetty..."
system "curl -L #{JETTY_URL} -o #{JETTY_ZIP}"
abort "Unable to download jetty from #{JETTY_URL}" unless $?.success?
end

task :unzip do
Rake::Task["jetty:download"].invoke unless File.exists? JETTY_ZIP
puts "Unpacking jetty..."
tmp_save_dir = File.join 'tmp', 'jetty_generator'
system "unzip -d #{tmp_save_dir} -qo #{JETTY_ZIP}"
abort "Unable to unzip #{JETTY_ZIP} into tmp_save_dir/" unless $?.success?

expanded_dir = Dir[File.join(tmp_save_dir, "hydra-jetty-*")].first

system "mv #{expanded_dir} #{JETTY_DIR}"
abort "Unable to move #{expanded_dir} into #{JETTY_DIR}/" unless $?.success?
end

task :clean do
system "rm -rf #{JETTY_DIR}"
Rake::Task["jetty:unzip"].invoke
end
end

namespace :active_fedora do
require 'active-fedora'

Expand Down Expand Up @@ -36,13 +67,6 @@ require 'rspec/core/rake_task'
spec.rcov = true
end

task :clean_jetty do
Dir.chdir("./jetty")
system("git clean -f -d")
system("git checkout .")
Dir.chdir("..")
end

desc "Loads or refreshes the fixtures needed to run the tests"
task :fixtures => :environment do
ENV["pid"] = "hydrangea:fixture_mods_article1"
Expand All @@ -60,16 +84,15 @@ require 'rspec/core/rake_task'

desc "Copies the default SOLR config for the bundled Testing Server"
task :configure_jetty do
Rake::Task["active_fedora:clean_jetty"].invoke
FileList['solr/conf/*'].each do |f|
cp("#{f}", 'jetty/solr/development-core/conf/', :verbose => true)
cp("#{f}", 'jetty/solr/test-core/conf/', :verbose => true)
end
end


desc "Hudson build"
task :hudson do
desc "CI build"
task :ci do
ENV['environment'] = "test"
Rake::Task["active_fedora:configure_jetty"].invoke
jetty_params = Jettywrapper.load_config
Expand Down

0 comments on commit fc80de0

Please sign in to comment.