Class: Autoproj::CLI::MainJenkins

Inherits:
Thor
  • Object
show all
Defined in:
lib/autoproj/cli/main_jenkins.rb

Overview

The 'jenkins' subcommand for autoproj

Instance Method Summary collapse

Instance Method Details

#init(url, *package_names) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/autoproj/cli/main_jenkins.rb', line 62

def init(url, *package_names)
    require 'autoproj/cli/jenkins'
    ops = create_ops(url, target_os: options[:target_os])

    ops.create_or_update_buildconf_job(
        *package_names,
        credentials_id: options[:credentials_id],
        vcs_credentials: options[:vcs_credentials],
        dev: options[:dev])
    if options[:trigger]
        ops.trigger_buildconf_job
    end
end

#postprocess_tests(output_dir, *package_names) ⇒ Object



97
98
99
100
101
102
103
104
# File 'lib/autoproj/cli/main_jenkins.rb', line 97

def postprocess_tests(output_dir, *package_names)
    require 'autoproj/cli/test_postprocessing'
    ops = TestPostprocessing.new(Workspace.default)
    if options[:after]
        reference_time = File.stat(options[:after]).mtime
    end
    ops.process(output_dir, *package_names, after: reference_time)
end

#relativize(root_dir, input_text, output_text) ⇒ Object



108
109
110
111
112
113
114
115
116
# File 'lib/autoproj/cli/main_jenkins.rb', line 108

def relativize(root_dir, input_text, output_text)
    require 'autoproj/jenkins'
    relativize = Autoproj::Jenkins::Relativize.new(Pathname.new(root_dir), input_text, output_text)
    processed_paths = relativize.process
    puts "modified #{processed_paths.size} file"
    processed_paths.each do |p|
        puts "  #{p}"
    end
end

#update(url, *package_names) ⇒ Object



82
83
84
85
86
87
88
89
90
91
# File 'lib/autoproj/cli/main_jenkins.rb', line 82

def update(url, *package_names)
    require 'autoproj/cli/jenkins'
    ops = create_ops(url)
    Autoproj.report(silent: !options[:debug], debug: options[:debug]) do
        updated_jobs = ops.add_or_update_packages(*package_names, dev: options[:dev], vcs_credentials: options[:vcs_credentials])
        updated_jobs.sort.each do |job_name|
            puts job_name
        end
    end
end