Sha256: 6a808302cba816b093152932891be05f6ff75a086c1ff5fcea9edeef6ac698b1

Contents?: true

Size: 1.47 KB

Versions: 1

Compression:

Stored size: 1.47 KB

Contents

require 'rspec/core/rake_task'
require 'cucumber/rake/task'

namespace :jenkins do :environment

  ENV['COVERAGE'] = 'on'
  ENV["RAILS_ENV"] ||= 'test'

  task :clean_rspec_reports do
    rm_rf "spec/reports"
  end

  task :clean_cucumber_reports do
    rm_rf "features/reports"
  end

  task :clean_reports => ["jenkins:clean_rspec_reports", "jenkins:clean_cucumber_reports"]

  task :migrate do
    sh "bundle exec rake db:migrate RAILS_ENV=#{ENV['RAILS_ENV']} "
  end

  task :rspec => "jenkins:clean_rspec_reports" do
    sh "bundle exec rspec spec --format CI::Reporter::RSpec"
  end

  task :cucumber => "jenkins:clean_cucumber_reports" do
    ENV["CUCUMBER_OPTS"] = "--format CI::Reporter::Cucumber --format junit --out features/reports"
    Rake::Task["app:cucumber"].invoke
  end

end

task :jenkins => ["jenkins:clean_reports", "jenkins:migrate", "jenkins:rspec", "jenkins:cucumber"]

namespace :active_metadata do

  desc "Install the active_metadata gem requirements file ***TASK IS ON ALPHA STAGE***"
  task :install do

    FileUtils.cp File.expand_path('../../../config/active_metadata.yml', __FILE__), File.expand_path('config/')
    puts "Installed active_metadata.yml"

    puts "Copying migrations"
    ts = Time.now.utc.strftime('%Y%m%d%H%M%S')
    FileUtils.cp File.expand_path('../../../db/migrate/02_active_metadata_migrations.rb', __FILE__), File.expand_path("db/migrate/#{ts}_active_metadata_migrations.rb")
    puts "run rake db:migrate to complete the gem installation"

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_metadata-0.6.5 lib/tasks/active_metadata_tasks.rake