1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-30 19:52:20 +01:00

Add fablab:openlab:bulk_update rake task

This commit is contained in:
Du Peng 2022-04-20 18:30:46 +02:00
parent b1e8b64ecc
commit dd5090826a
2 changed files with 16 additions and 4 deletions

View File

@ -4,9 +4,9 @@
- Fix a bug: back bouton can't return to previously page in projects page (list/new/show/edit)
- Fix a security issue: updated async to 2.6.4 to fix [CVE-2021-43138](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-43138)
- Fix a bug on OpenLab Projects, if you are using OpenLab Projects, please follow the following TODO DEPLOY
- [TODO DEPLOY] `rails runner 'Project.all.each { |pr| pr.openlab_create }'`
- [TODO DEPLOY] `rails fablab:openlab:bulk_export`
- [TODO DEPLOY] wait 1 minute
- [TODO DEPLOY] `rails runner 'Project.all.each { |pr| pr.openlab_update }'`
- [TODO DEPLOY] `rails fablab:openlab:bulk_update`
## v5.3.11 2022 April 15

View File

@ -5,13 +5,25 @@ namespace :fablab do
namespace :openlab do
desc 'bulk and export projects to openlab'
task bulk_export: :environment do
if Setting.get('openlab_app_secret').present?
if Setting.get('openlab_app_id').present? && Setting.get('openlab_app_secret').present?
Project.find_each do |project|
project.openlab_create
puts '-> Done'
end
else
warn "Openlab_app_secret was not configured. Export can't be done."
warn "openlab_app_id or openlab_app_secret was not configured. Export can't be done."
end
end
desc 'bulk update projects to openlab'
task bulk_update: :environment do
if Setting.get('openlab_app_id').present? && Setting.get('openlab_app_secret').present?
Project.find_each do |project|
project.openlab_update
puts '-> Done'
end
else
warn "openlab_app_id or openlab_app_secret was not configured. Update can't be done."
end
end
end