Class: LeeroyJenkins::Cli
- Inherits:
-
Thor
- Object
- Thor
- LeeroyJenkins::Cli
- Defined in:
- lib/leeroy_jenkins/cli.rb
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
exit non-zero on failure github.com/erikhuda/thor/issues/244.
Instance Method Summary collapse
- #append(xml_file_path) ⇒ Object
- #backup(backup_dir) ⇒ Object
- #delete ⇒ Object
- #replace(xml_file_path) ⇒ Object
- #restore(backup_dir) ⇒ Object
Class Method Details
.exit_on_failure? ⇒ Boolean
exit non-zero on failure github.com/erikhuda/thor/issues/244
5 6 7 |
# File 'lib/leeroy_jenkins/cli.rb', line 5 def self.exit_on_failure? true end |
Instance Method Details
#append(xml_file_path) ⇒ Object
21 22 23 |
# File 'lib/leeroy_jenkins/cli.rb', line 21 def append(xml_file_path) puts update_jobs(read_and_validate_xml_file(xml_file_path), __method__) end |
#backup(backup_dir) ⇒ Object
38 39 40 |
# File 'lib/leeroy_jenkins/cli.rb', line 38 def backup(backup_dir) puts JobBackupper.new(job_names, jenkins_client, backup_dir, [:threads]).backup([:dry_run]) end |
#delete ⇒ Object
33 34 35 |
# File 'lib/leeroy_jenkins/cli.rb', line 33 def delete puts update_jobs('', __method__) end |
#replace(xml_file_path) ⇒ Object
27 28 29 |
# File 'lib/leeroy_jenkins/cli.rb', line 27 def replace(xml_file_path) puts update_jobs(read_and_validate_xml_file(xml_file_path), __method__) end |
#restore(backup_dir) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/leeroy_jenkins/cli.rb', line 43 def restore(backup_dir) job_restorer = JobRestorer.new(jenkins_client, backup_dir, [:threads], job_rows, [:job_regex]) result = [:dry_run] ? job_restorer.dry_run : job_restorer.restore! puts result end |