Sha256: 60039e8b73d4cb82e11009f713e06e28d7621daffe082e073ecda2afe106ce5a

Contents?: true

Size: 974 Bytes

Versions: 12

Compression:

Stored size: 974 Bytes

Contents

desc 'Import or update SCAP datastreams from the SCAP Security Guide'
namespace :ssg do
  desc 'Import or update SCAP datastreams for RHEL 6, 7, and 8'
  task :sync_rhel do |task|
    RHEL_SSG_VERSIONS = (
      'v0.1.28:rhel6,'\
      'v0.1.43:rhel7,'\
      'v0.1.42:rhel8'
    )

    ENV['DATASTREAMS'] = RHEL_SSG_VERSIONS
    Rake::Task['ssg:sync'].invoke
  end

  desc 'Import or update SCAP datastreams, '\
    'provided as a comma separated list: '\
    '`rake ssg:sync DATASTREAMS=v0.1.43:rhel7,latest:fedora`'
  task :sync do |task|
    DATASTREAMS = ENV.fetch('DATASTREAMS', '').split(',')
      .inject({}) do |datastreams, arg|
      version, datastream = arg.split(':')
      datastreams[version] = (datastreams[version] || []).push(datastream)

      datastreams
    end

    require 'ssg'

    ds_zip_filenames = Ssg::Downloader.download!(DATASTREAMS.keys)
    DATASTREAM_FILENAMES = Ssg::Unarchiver.
      unarchive!(ds_zip_filenames, DATASTREAMS)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
openscap_parser-1.7.0 lib/tasks/ssg.rake
openscap_parser-1.6.0 lib/tasks/ssg.rake
openscap_parser-1.5.1 lib/tasks/ssg.rake
openscap_parser-1.5.0 lib/tasks/ssg.rake
openscap_parser-1.4.0 lib/tasks/ssg.rake
openscap_parser-1.3.1 lib/tasks/ssg.rake
openscap_parser-1.3.0 lib/tasks/ssg.rake
openscap_parser-1.2.0 lib/tasks/ssg.rake
openscap_parser-1.1.0 lib/tasks/ssg.rake
openscap_parser-1.0.2 lib/tasks/ssg.rake
openscap_parser-1.0.1 lib/tasks/ssg.rake
openscap_parser-1.0.0 lib/tasks/ssg.rake