2019-02-13 12:59:28 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# OpenLab Projects tasks
|
2016-04-21 11:42:43 +02:00
|
|
|
namespace :fablab do
|
|
|
|
namespace :openlab do
|
2016-09-29 21:28:51 +02:00
|
|
|
desc 'bulk and export projects to openlab'
|
2016-04-21 11:42:43 +02:00
|
|
|
task bulk_export: :environment do
|
2020-06-08 15:08:07 +02:00
|
|
|
if Setting.get('openlab_app_secret').present?
|
2016-04-21 11:42:43 +02:00
|
|
|
Project.find_each do |project|
|
|
|
|
project.openlab_create
|
2016-09-29 20:50:27 +02:00
|
|
|
puts '-> Done'
|
2016-04-21 11:42:43 +02:00
|
|
|
end
|
|
|
|
else
|
2020-06-08 15:08:07 +02:00
|
|
|
warn "Openlab_app_secret was not configured. Export can't be done."
|
2016-04-21 11:42:43 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|