Sha256: 21f76fd41ad1ae65845f62120a7a354ec6803dee475098acf3b2d740f2031973

Contents?: true

Size: 1.49 KB

Versions: 4

Compression:

Stored size: 1.49 KB

Contents

task :restart do
  system "touch tmp/restart.txt"
  system "touch tmp/debug.txt" if ENV["DEBUG"] == 'true'
end

desc "Bootstrap project"
task :bootstrap => %w(bootstrap:files db:create db:migrate restart)

namespace :bootstrap do
  desc "Bootstrap project to run tests"
  task :test => :bootstrap do
    system "rake db:create db:migrate RAILS_ENV=test" unless ENV['RAILS_ENV'] == "test"
  end

  desc "Bootstrap project to run in production"
  task :production => :bootstrap do
    if %w(app/stylesheets app/sass public/stylesheets/sass).any? { |file| File.exist?(file) }
      Sass::Plugin.options[:always_update] = true;
      Sass::Plugin.update_stylesheets
    end
    Rake::Task["barista:brew"].invoke if Rake::Task.task_defined?("barista:brew")
    Rake::Task["asset:packager:build_all"].invoke if File.exist?("vendor/plugins/asset_packager")
    Rake::Task["bootstrap:production:post"].invoke if Rake::Task.task_defined?("bootstrap:production:post")
  end

  namespace :production do
    task :post do
    end
  end

  task :files do
    system "git submodule sync"
    system "git submodule init"
    system "git submodule update --merge"
    system "git submodule foreach 'git checkout `git name-rev --name-only HEAD`'"
    system "cp config/database.sample.yml config/database.yml" unless File.exist?('config/database.yml')
  end
end

Rake::Task[:default].clear if Rake::Task.task_defined?(:default)
desc "Bootstrap the current project and run the tests."
task :default => ["bootstrap:test", :spec, :cucumber]

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bard-rake-0.3.1 lib/bard/rake/bootstrap.rb
bard-rake-0.3.0 lib/bard/rake/bootstrap.rb
bard-rake-0.2.1 lib/bard/rake/bootstrap.rb
bard-rake-0.2.0 lib/bard/rake/bootstrap.rb