Sha256: d5225fc7e75c5729d96283568cbbb3c97adb1f58b635d90eed6f792c08712909

Contents?: true

Size: 1.24 KB

Versions: 8

Compression:

Stored size: 1.24 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

# Always look in the lib directory of this gem
# first when searching the load path
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)

require 'bundler/audit/cli'
require 'fast_ci'
require 'base64'
require 'zlib'

$stdout = StringIO.new()
def $stdout.tty?
  true
end

events = []

at_exit do
  output = $stdout.string
  $stdout = STDOUT

  if $!.nil? || ($!.is_a?(SystemExit) && $!.success?)
    code = 0
  else
    code = $!.is_a?(SystemExit) ? $!.status : 1
  end

  data = {
    exitstatus: code,
    output: "$ bundle-audit --update\n\n" + output,
    key: 'bundler_audit',
    index: 0,
    title: 'Perform',
  }
  events << ['custom_exit_status'.upcase, ['0', data]]

  if ENV['FSCI_REMOTE_TESTS'] == 'true'
    json_events = {
      build_id: FastCI.configuration.orig_build_id,
      compressed_data: Base64.strict_encode64(Zlib::Deflate.deflate(JSON.fast_generate(events), 9)),
    }

    FastCI.send_events(json_events)
  else
    compressed_data = ::Base64.strict_encode64(Zlib::Deflate.deflate(output, 9))
    FastCI.report_bundler_audit(compressed_data, (code == 0) ? 'passed' : 'failed')
  end

  output
end

events << ['custom_started'.upcase, ['0', { key: 'bundler_audit' }]]
Bundler::Audit::CLI.start

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fast_ci-1.0.7 bin/fastci_bundle_audit
fast_ci-1.0.6 bin/fastci_bundle_audit
fast_ci-1.0.5 bin/fastci_bundle_audit
fast_ci-1.0.4 bin/fastci_bundle_audit
fast_ci-1.0.3 bin/fastci_bundle_audit
fast_ci-1.0.2 bin/fastci_bundle_audit
fast_ci-1.0.1 bin/fastci_bundle_audit
fast_ci-1.0.0 bin/fastci_bundle_audit