annotate .svn/pristine/d6/d6fa2ab030f2e7ebc86e650e4acc6d8328176458.svn-base @ 1327:287f201c2802 redmine-2.2-integration

Add italic
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Wed, 19 Jun 2013 20:56:22 +0100
parents 038ba2d95de8
children
rev   line source
Chris@1296 1 # Redmine - project management software
Chris@1296 2 # Copyright (C) 2006-2012 Jean-Philippe Lang
Chris@1296 3 #
Chris@1296 4 # This program is free software; you can redistribute it and/or
Chris@1296 5 # modify it under the terms of the GNU General Public License
Chris@1296 6 # as published by the Free Software Foundation; either version 2
Chris@1296 7 # of the License, or (at your option) any later version.
Chris@1296 8 #
Chris@1296 9 # This program is distributed in the hope that it will be useful,
Chris@1296 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@1296 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@1296 12 # GNU General Public License for more details.
Chris@1296 13 #
Chris@1296 14 # You should have received a copy of the GNU General Public License
Chris@1296 15 # along with this program; if not, write to the Free Software
Chris@1296 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Chris@1296 17
Chris@1296 18 namespace :redmine do
Chris@1296 19 namespace :attachments do
Chris@1296 20 desc 'Removes uploaded files left unattached after one day.'
Chris@1296 21 task :prune => :environment do
Chris@1296 22 Attachment.prune
Chris@1296 23 end
Chris@1296 24 end
Chris@1296 25
Chris@1296 26 namespace :tokens do
Chris@1296 27 desc 'Removes expired tokens.'
Chris@1296 28 task :prune => :environment do
Chris@1296 29 Token.destroy_expired
Chris@1296 30 end
Chris@1296 31 end
Chris@1296 32
Chris@1296 33 namespace :watchers do
Chris@1296 34 desc 'Removes watchers from what they can no longer view.'
Chris@1296 35 task :prune => :environment do
Chris@1296 36 Watcher.prune
Chris@1296 37 end
Chris@1296 38 end
Chris@1296 39
Chris@1296 40 desc 'Fetch changesets from the repositories'
Chris@1296 41 task :fetch_changesets => :environment do
Chris@1296 42 Repository.fetch_changesets
Chris@1296 43 end
Chris@1296 44
Chris@1296 45 desc 'Migrates and copies plugins assets.'
Chris@1296 46 task :plugins do
Chris@1296 47 Rake::Task["redmine:plugins:migrate"].invoke
Chris@1296 48 Rake::Task["redmine:plugins:assets"].invoke
Chris@1296 49 end
Chris@1296 50
Chris@1296 51 namespace :plugins do
Chris@1296 52 desc 'Migrates installed plugins.'
Chris@1296 53 task :migrate => :environment do
Chris@1296 54 name = ENV['NAME']
Chris@1296 55 version = nil
Chris@1296 56 version_string = ENV['VERSION']
Chris@1296 57 if version_string
Chris@1296 58 if version_string =~ /^\d+$/
Chris@1296 59 version = version_string.to_i
Chris@1296 60 if name.nil?
Chris@1296 61 abort "The VERSION argument requires a plugin NAME."
Chris@1296 62 end
Chris@1296 63 else
Chris@1296 64 abort "Invalid VERSION #{version_string} given."
Chris@1296 65 end
Chris@1296 66 end
Chris@1296 67
Chris@1296 68 begin
Chris@1296 69 Redmine::Plugin.migrate(name, version)
Chris@1296 70 rescue Redmine::PluginNotFound
Chris@1296 71 abort "Plugin #{name} was not found."
Chris@1296 72 end
Chris@1296 73
Chris@1296 74 Rake::Task["db:schema:dump"].invoke
Chris@1296 75 end
Chris@1296 76
Chris@1296 77 desc 'Copies plugins assets into the public directory.'
Chris@1296 78 task :assets => :environment do
Chris@1296 79 name = ENV['NAME']
Chris@1296 80
Chris@1296 81 begin
Chris@1296 82 Redmine::Plugin.mirror_assets(name)
Chris@1296 83 rescue Redmine::PluginNotFound
Chris@1296 84 abort "Plugin #{name} was not found."
Chris@1296 85 end
Chris@1296 86 end
Chris@1296 87
Chris@1296 88 desc 'Runs the plugins tests.'
Chris@1296 89 task :test do
Chris@1296 90 Rake::Task["redmine:plugins:test:units"].invoke
Chris@1296 91 Rake::Task["redmine:plugins:test:functionals"].invoke
Chris@1296 92 Rake::Task["redmine:plugins:test:integration"].invoke
Chris@1296 93 end
Chris@1296 94
Chris@1296 95 namespace :test do
Chris@1296 96 desc 'Runs the plugins unit tests.'
Chris@1296 97 Rake::TestTask.new :units => "db:test:prepare" do |t|
Chris@1296 98 t.libs << "test"
Chris@1296 99 t.verbose = true
Chris@1296 100 t.pattern = "plugins/#{ENV['NAME'] || '*'}/test/unit/**/*_test.rb"
Chris@1296 101 end
Chris@1296 102
Chris@1296 103 desc 'Runs the plugins functional tests.'
Chris@1296 104 Rake::TestTask.new :functionals => "db:test:prepare" do |t|
Chris@1296 105 t.libs << "test"
Chris@1296 106 t.verbose = true
Chris@1296 107 t.pattern = "plugins/#{ENV['NAME'] || '*'}/test/functional/**/*_test.rb"
Chris@1296 108 end
Chris@1296 109
Chris@1296 110 desc 'Runs the plugins integration tests.'
Chris@1296 111 Rake::TestTask.new :integration => "db:test:prepare" do |t|
Chris@1296 112 t.libs << "test"
Chris@1296 113 t.verbose = true
Chris@1296 114 t.pattern = "plugins/#{ENV['NAME'] || '*'}/test/integration/**/*_test.rb"
Chris@1296 115 end
Chris@1296 116 end
Chris@1296 117 end
Chris@1296 118 end
Chris@1296 119
Chris@1296 120 # Load plugins' rake tasks
Chris@1296 121 Dir[File.join(Rails.root, "plugins/*/lib/tasks/**/*.rake")].sort.each { |ext| load ext }