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



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/autoproj/cli/main_jenkins.rb', line 64

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

    if options[:seed]
        seed = File.read(options[:seed])
    end

    ops.create_or_update_buildconf_job(
        *package_names,
        seed: seed,
        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



111
112
113
114
115
116
117
118
# File 'lib/autoproj/cli/main_jenkins.rb', line 111

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



122
123
124
125
126
127
128
129
130
# File 'lib/autoproj/cli/main_jenkins.rb', line 122

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



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/autoproj/cli/main_jenkins.rb', line 91

def update(url, *package_names)
    require 'autoproj/cli/jenkins'

    if options[:seed]
        seed = File.read(options[:seed])
    end

    ops = create_ops(url)
    Autoproj.report(silent: !options[:debug], debug: options[:debug]) do
        updated_jobs = ops.add_or_update_packages(*package_names, seed: seed, dev: options[:dev], vcs_credentials: options[:vcs_credentials])
        updated_jobs.sort.each do |job_name|
            puts job_name
        end
    end
end