summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2015-04-22 12:41:13 +0200
committerHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2018-01-14 03:26:14 +0100
commit150376ff84a58184fa6a725206afa2e6f6cf7229 (patch)
treee99ba93088a18e450ced8b96bdc5b0d4e6cb6802
downloadecs_vip_template-150376ff84a58184fa6a725206afa2e6f6cf7229.tar.gz
ecs_vip_template-150376ff84a58184fa6a725206afa2e6f6cf7229.zip
VIP template.
Initial commit.
-rw-r--r--ecs_vip.rb68
1 files changed, 68 insertions, 0 deletions
diff --git a/ecs_vip.rb b/ecs_vip.rb
new file mode 100644
index 0000000..8c8a13c
--- /dev/null
+++ b/ecs_vip.rb
@@ -0,0 +1,68 @@
+# 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 <http://www.gnu.org/licenses/>.
+
+
+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?
+ end
+end
+CODE
+
+rake "db:seed_vip"