Skip to content

Instantly share code, notes, and snippets.

@lmullen
Last active December 15, 2015 08:19
Show Gist options
  • Save lmullen/5230226 to your computer and use it in GitHub Desktop.
Save lmullen/5230226 to your computer and use it in GitHub Desktop.
A Rakefile to install my Omeka development server
desc "There is no default task"
task :default do
puts "There is no default task. Try one of these:"
sh "rake --tasks"
end
desc "Setup Omeka"
task :setup_omeka => [:omeka_download, "omeka-dev", :omeka_copy_files, :omeka_install_official_plugins, :omeka_link_dev_theme, :omeka_link_dev_plugins] do
puts "Omeka is setup."
end
# Helper tasks for installing Omeka
# -------------------------------------------------------------------
omeka_version = "2.0.2"
task :omeka_download do
unless File.exists? "omeka-#{omeka_version}.zip"
puts "Downloading Omeka ..."
`curl -O http://omeka.org/files/omeka-#{omeka_version}.zip`
end
end
file "omeka-dev" do
puts "Unzipping into omeka-dev ..."
`unzip -oq omeka-#{omeka_version}.zip`
FileUtils.mv "omeka-#{omeka_version}", "omeka-dev", :force => true
end
task :omeka_copy_files => [:omeka_download] do
puts "Moving Omeka files ..."
# `unzip -oq omeka-#{omeka_version}.zip`
# fileutils.mv "omeka-#{omeka_version}", "omeka-dev", :force => true
FileUtils.cp "omeka.db.ini", "omeka-dev/db.ini"
FileUtils.cp "omeka.htaccess", "omeka-dev/.htaccess"
FileUtils.chmod_R 0777, "omeka-dev/files"
end
omeka_plugins_url = "http://omeka.org/wordpress/wp-content/uploads/"
omeka_plugins_list = [
"PDF-Text-1.0.zip",
"LC-Suggest-2.0.zip",
"HTML5-Media-2.0.zip",
"Collection-Tree-2.0.zip",
"Social-Bookmarking-2.0.zip",
"Simple-Vocab-2.0.zip",
"SimpleContactForm-0.4.zip",
"Simple-Pages-2.0.zip",
"Exhibit-Builder-2.0.2.zip",
"Dublin-Core-Extended-2.0.zip",
"Dropbox-0.7.1.zip",
"Docs-Viewer-2.0.zip",
"CSV-Import-2.0.zip",
"COinS-2.0.1.zip"
]
task :omeka_install_official_plugins do
omeka_plugins_list.each do |file|
unless File.exists? file
puts "Downloading plugin #{file}"
`curl -O #{omeka_plugins_url}#{file}`
end
puts "Unzipping plugin #{file}"
`unzip -oq #{file} -d omeka-dev/plugins/`
end
end
task :omeka_link_dev_theme do
puts "Linking custom theme ..."
FileUtils.ln_s "/Users/lmullen/dev/americanconverts-theme/", "omeka-dev/themes/americanconverts", :force => true
end
task :omeka_link_dev_plugins do
puts "Linking development plugins ..."
FileUtils.ln_s "/Users/lmullen/dev/CatalogSearch/", "omeka-dev/plugins/", :force => true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment