diff --git a/CHANGELOG.md b/CHANGELOG.md index 37e47778f..0d66df6ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/tasks/fablab/openlab.rake b/lib/tasks/fablab/openlab.rake index 41bcb7d1c..927593e14 100644 --- a/lib/tasks/fablab/openlab.rake +++ b/lib/tasks/fablab/openlab.rake @@ -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