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
|
|
|
|
if Rails.application.secrets.openlab_app_secret.present?
|
|
|
|
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
|
|
|
|
warn "Rails.application.secrets.openlab_app_secret not present. Export can't be done."
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|