Sha256: 86d784a7345d1396ab05077cf29e5918115a165976e9696cf6b06028daf0a486

Contents?: true

Size: 728 Bytes

Versions: 1

Compression:

Stored size: 728 Bytes

Contents

# frozen_string_literal: true

require "json"
require "colorize"

module CodeclimateDiff
  class CodeclimateWrapper

    def run_codeclimate(filename = "")
      docker_platform = CodeclimateDiff.configuration["docker_platform"] || "linux/amd64"

      `docker run \
        --interactive --tty --rm \
        --env CODECLIMATE_CODE="$PWD" \
        --volume "$PWD":/code \
        --volume /var/run/docker.sock:/var/run/docker.sock \
        --volume /tmp/cc:/tmp/cc \
        --platform #{docker_platform} \
        codeclimate/codeclimate analyze -f json #{filename}`
    end

    def pull_latest_image
      puts "Downloading latest codeclimate docker image..."
      `docker pull codeclimate/codeclimate`
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codeclimate_diff-0.1.10 lib/codeclimate_diff/codeclimate_wrapper.rb