Class: Metanorma::Release::CLI
- Inherits:
-
Thor
- Object
- Thor
- Metanorma::Release::CLI
- Defined in:
- lib/metanorma/release/cli.rb
Defined Under Namespace
Classes: PipelineError
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
8 9 10 |
# File 'lib/metanorma/release/cli.rb', line 8 def self.exit_on_failure? true end |
Instance Method Details
#aggregate ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/metanorma/release/cli.rb', line 92 def aggregate config = AggregateCommand::Config.new( source: [:source], organizations: [:organizations], topic: [:topic], repos: [:repos], channels: [:channels], stages: [:stages], output_dir: [:output_dir], file_routing: [:file_routing], cache_dir: [:cache_dir], include_drafts: [:include_drafts], concurrency: [:concurrency], min_documents: [:min_documents], token: [:token], create_zip: nil, ) result = AggregateCommand.new(config).call print_aggregate_result(result) if [:min_documents].positive? && result.publications.length < [:min_documents] raise PipelineError, "Found #{result.publications.length} documents, minimum is #{[:min_documents]}" end unless result.failed_repos.empty? raise PipelineError, format_repo_failures(result) end end |
#package ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/metanorma/release/cli.rb', line 23 def package config = PackageCommand::Config.new( output_dir: [:output_dir], dest: [:dest], manifest: [:manifest], config_source: [:config], ) result = PackageCommand.new(config).call print_package_result(result, config.dest) raise PipelineError, format_failures(result) unless result.failed.empty? end |
#release ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/metanorma/release/cli.rb', line 51 def release config = ReleaseCommand::Config.new( output_dir: [:output_dir], platform: [:platform], manifest: [:manifest], force: [:force], force_replace: [:force_replace], channels: [:channels], concurrency: [:concurrency], token: [:token], config_source: [:config], ) result = ReleaseCommand.new(config).call print_publish_result(result) raise PipelineError, format_failures(result) unless result.failed.empty? end |