Files
edx-platform/rakelib/workspace.rake
Calen Pennington 83af3e594f Use built-in rakelibdir feature
Rake by default imports all .rake files in the rakelib dir, so we can
use that rather than doing our own import loop.
2013-06-20 09:11:45 -04:00

16 lines
576 B
Ruby

MIGRATION_MARKER_DIR = File.join(REPO_ROOT, '.ws_migrations_complete')
SKIP_MIGRATIONS = ENV['SKIP_WS_MIGRATIONS'] || false
directory MIGRATION_MARKER_DIR
namespace :ws do
task :migrate => MIGRATION_MARKER_DIR do
Dir['ws_migrations/*'].select{|m| File.executable?(m)}.each do |migration|
completion_file = File.join(MIGRATION_MARKER_DIR, File.basename(migration))
if ! File.exist?(completion_file)
sh(migration)
File.write(completion_file, "")
end
end unless SKIP_MIGRATIONS
end
end