archivos de configuracion, scripts y assets customizados de greenlight, scalelite y bigbluebutton
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

scalelite_post_publish.rb 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/usr/bin/ruby
  2. # frozen_string_literal: true
  3. # Scalelite recording transfer script
  4. # Copyright © 2020 Blindside Networks
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU Affero General Public License as
  8. # published by the Free Software Foundation, either version 3 of the
  9. # License, or (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU Affero General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU Affero General Public License
  17. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. require 'optparse'
  19. require 'psych'
  20. require 'fileutils'
  21. meeting_id = nil
  22. OptionParser.new do |opts|
  23. opts.on('-m', '--meeting-id MEETING_ID', 'Internal Meeting ID') do |v|
  24. meeting_id = v
  25. end
  26. end.parse!
  27. raise 'Meeting ID was not provided' unless meeting_id
  28. props = Psych.load_file(File.join(__dir__, '../bigbluebutton.yml'))
  29. published_dir = props['published_dir'] || raise('Unable to determine published_dir from bigbluebutton.yml')
  30. scalelite_props = Psych.load_file(File.join(__dir__, '../scalelite.yml'))
  31. work_dir = scalelite_props['work_dir'] || raise('Unable to determine work_dir from scalelite.yml')
  32. spool_dir = scalelite_props['spool_dir'] || raise('Unable to determine spool_dir from scalelite.yml')
  33. extra_rsync_opts = scalelite_props['extra_rsync_opts'] || []
  34. puts("Transferring recording for #{meeting_id} to Scalelite")
  35. format_dirs = []
  36. FileUtils.cd(published_dir) do
  37. format_dirs = Dir.glob("*/#{meeting_id}")
  38. end
  39. if format_dirs.empty?
  40. puts('No published recording formats found')
  41. exit
  42. end
  43. format_dirs.each do |format_dir|
  44. puts("Found recording format: #{format_dir}")
  45. end
  46. archive_file = "#{work_dir}/#{meeting_id}.tar"
  47. begin
  48. puts('Creating recording archive')
  49. FileUtils.mkdir_p(work_dir)
  50. FileUtils.cd(published_dir) do
  51. system('tar', '--create', '--file', archive_file, *format_dirs) \
  52. || raise('Failed to create recording archive')
  53. end
  54. puts("Transferring recording archive to #{spool_dir}")
  55. system('cp', archive_file, spool_dir) \
  56. || raise('Failed to transfer recording archive')
  57. ensure
  58. FileUtils.rm_f(archive_file)
  59. end