Class: BoringBuilder::Builder
- Inherits:
-
Object
- Object
- BoringBuilder::Builder
- Defined in:
- lib/boringbuilder/builder.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#progress ⇒ Object
readonly
Returns the value of attribute progress.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(configuration, progress: DaggerRuby::Progress.silent) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(configuration, progress: DaggerRuby::Progress.silent) ⇒ Builder
Returns a new instance of Builder.
9 10 11 12 |
# File 'lib/boringbuilder/builder.rb', line 9 def initialize(configuration, progress: DaggerRuby::Progress.silent) @configuration = configuration @progress = progress end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
7 8 9 |
# File 'lib/boringbuilder/builder.rb', line 7 def configuration @configuration end |
#progress ⇒ Object (readonly)
Returns the value of attribute progress.
7 8 9 |
# File 'lib/boringbuilder/builder.rb', line 7 def progress @progress end |
Instance Method Details
#build ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/boringbuilder/builder.rb', line 14 def build project = Project.new(configuration).validate! runtime = Runtime.new(configuration.runtime) resolved_runtime = runtime.resolve dagger_configuration = DaggerRuby::Config.new( runtime: runtime.dagger_runtime(resolved_runtime), progress: configuration.progress, silent: configuration.progress.nil? ) DaggerRuby.connection(dagger_configuration) do |client| container = project.container(client, progress: progress) Exporter.new(project, client, container, runtime: resolved_runtime, progress: progress).call end rescue DaggerRuby::DaggerError => e = e..sub(/\s*\[traceparent:[^\]]+\]\s*\z/, "") raise BuildError, "Dagger build failed: #{}" end |