Class: JenkinsPipelineBuilder::CLI::Pipeline

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/jenkins_pipeline_builder/cli/pipeline.rb

Overview

This class provides various command line operations related to jobs.

Instance Method Summary collapse

Instance Method Details

#bootstrap(path, project_name = nil) ⇒ Object



35
36
37
38
39
40
# File 'lib/jenkins_pipeline_builder/cli/pipeline.rb', line 35

def bootstrap(path, project_name = nil)
  failed = Helper.setup(parent_options).bootstrap(path, project_name)
  exit(0) if failed.empty? # weird ordering, but rubocop decrees
  JenkinsPipelineBuilder.logger.error 'Encountered error during run'
  exit(1)
end

#dump(job_name) ⇒ Object



30
31
32
# File 'lib/jenkins_pipeline_builder/cli/pipeline.rb', line 30

def dump(job_name)
  Helper.setup(parent_options).dump(job_name)
end

#file(path, project_name = nil) ⇒ Object



49
50
51
# File 'lib/jenkins_pipeline_builder/cli/pipeline.rb', line 49

def file(path, project_name = nil)
  Helper.setup(parent_options).file(path, project_name)
end

#pull_request(path, project_name = nil) ⇒ Object



44
45
46
# File 'lib/jenkins_pipeline_builder/cli/pipeline.rb', line 44

def pull_request(path, project_name = nil)
  Helper.setup(parent_options).pull_request(path, project_name, options[:base_branch_only])
end