# Copyright (C) 2015 # Heiko Bernloehr (FreeIT.de). # # This file is part of ECS. # # ECS is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # ECS is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public # License along with ECS. If not, see . rakefile 'vip.rake', <<-CODE namespace :db do desc "Create VIP resources" task :seed_vip => :environment do Ressource.create :namespace => 'numlab', :ressource => 'cpp_exercises', :postroute => false, :events => true if Ressource.find_by_namespace_and_ressource("numlab","cpp_exercises").nil? Ressource.create :namespace => 'numlab', :ressource => 'cpp_results', :postroute => false, :events => true if Ressource.find_by_namespace_and_ressource("numlab","cpp_results").nil? Ressource.create :namespace => 'numlab', :ressource => 'cpp_solutions', :postroute => false, :events => true if Ressource.find_by_namespace_and_ressource("numlab","cpp_solutions").nil? Ressource.create :namespace => 'numlab', :ressource => 'dumux_exercises', :postroute => false, :events => true if Ressource.find_by_namespace_and_ressource("numlab","dumux_exercises").nil? Ressource.create :namespace => 'numlab', :ressource => 'dumux_results', :postroute => false, :events => true if Ressource.find_by_namespace_and_ressource("numlab","dumux_results").nil? Ressource.create :namespace => 'numlab', :ressource => 'dumux_solutions', :postroute => false, :events => true if Ressource.find_by_namespace_and_ressource("numlab","dumux_solutions").nil? Ressource.create :namespace => 'numlab', :ressource => 'evaluations', :postroute => false, :events => true if Ressource.find_by_namespace_and_ressource("numlab","evaluations").nil? Ressource.create :namespace => 'numlab', :ressource => 'exercises', :postroute => false, :events => true if Ressource.find_by_namespace_and_ressource("numlab","exercises").nil? Ressource.create :namespace => 'numlab', :ressource => 'results', :postroute => false, :events => true if Ressource.find_by_namespace_and_ressource("numlab","results").nil? Ressource.create :namespace => 'numlab', :ressource => 'solutions', :postroute => false, :events => true if Ressource.find_by_namespace_and_ressource("numlab","solutions").nil? Ressource.create :namespace => 'numlab', :ressource => 'evaluation_jobs', :postroute => false, :events => true if Ressource.find_by_namespace_and_ressource("numlab","evaluation_jobs").nil? Ressource.create :namespace => 'numlab', :ressource => 'points', :postroute => false, :events => true if Ressource.find_by_namespace_and_ressource("numlab","points").nil? end end CODE rake "db:seed_vip"