Class: Taeval::Hadolint::Runner
- Inherits:
-
Object
- Object
- Taeval::Hadolint::Runner
- Defined in:
- lib/taeval/hadolint/runner.rb
Instance Method Summary collapse
-
#initialize(config, output, reporter) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/taeval/hadolint/runner.rb', line 14 def run solutions = Dir.glob("#{@config.solutions}/*") solutions.each do |repo| cmd = "docker run --rm -i -v #{@config.path}:/root/.config/hadolint.yaml hadolint/hadolint < #{repo}/docker/Dockerfile" stdout, stderr, status = Open3.capture3(cmd) @output.print "hadolint #{repo}/Dockerfile", stdout, stderr if 0 != status @reporter.add(repo: repo, runner: :hadolint, msg: "Status: #{status} Error: #{stderr}.") if !stderr.empty? @reporter.add(repo: repo, runner: :hadolint, msg: "Status: #{status} Message: #{stdout}.") if !stdout.empty? end end end |