Class: Mrsk::Configuration::Builder
- Inherits:
-
Object
- Object
- Mrsk::Configuration::Builder
- Defined in:
- lib/mrsk/configuration/builder.rb
Instance Method Summary collapse
- #args ⇒ Object
- #cache_from ⇒ Object
- #cache_to ⇒ Object
- #cached? ⇒ Boolean
- #context ⇒ Object
- #dockerfile ⇒ Object
-
#initialize(config:) ⇒ Builder
constructor
A new instance of Builder.
- #local? ⇒ Boolean
- #local_arch ⇒ Object
- #local_host ⇒ Object
- #multiarch? ⇒ Boolean
- #remote? ⇒ Boolean
- #remote_arch ⇒ Object
- #remote_host ⇒ Object
- #secrets ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(config:) ⇒ Builder
Returns a new instance of Builder.
2 3 4 5 6 7 8 |
# File 'lib/mrsk/configuration/builder.rb', line 2 def initialize(config:) @options = config.raw_config.builder || {} @image = config.image @server = config.registry["server"] valid? end |
Instance Method Details
#args ⇒ Object
30 31 32 |
# File 'lib/mrsk/configuration/builder.rb', line 30 def args @options["args"] || {} end |
#cache_from ⇒ Object
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/mrsk/configuration/builder.rb', line 62 def cache_from if cached? case @options["cache"]["type"] when "gha" cache_from_config_for_gha when "registry" cache_from_config_for_registry end end end |
#cache_to ⇒ Object
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/mrsk/configuration/builder.rb', line 73 def cache_to if cached? case @options["cache"]["type"] when "gha" cache_to_config_for_gha when "registry" cache_to_config_for_registry end end end |
#cached? ⇒ Boolean
26 27 28 |
# File 'lib/mrsk/configuration/builder.rb', line 26 def cached? !!@options["cache"] end |
#context ⇒ Object
42 43 44 |
# File 'lib/mrsk/configuration/builder.rb', line 42 def context @options["context"] || "." end |
#dockerfile ⇒ Object
38 39 40 |
# File 'lib/mrsk/configuration/builder.rb', line 38 def dockerfile @options["dockerfile"] || "Dockerfile" end |
#local? ⇒ Boolean
18 19 20 |
# File 'lib/mrsk/configuration/builder.rb', line 18 def local? !!@options["local"] end |
#local_arch ⇒ Object
46 47 48 |
# File 'lib/mrsk/configuration/builder.rb', line 46 def local_arch @options["local"]["arch"] if local? end |
#local_host ⇒ Object
50 51 52 |
# File 'lib/mrsk/configuration/builder.rb', line 50 def local_host @options["local"]["host"] if local? end |
#multiarch? ⇒ Boolean
14 15 16 |
# File 'lib/mrsk/configuration/builder.rb', line 14 def multiarch? @options["multiarch"] != false end |
#remote? ⇒ Boolean
22 23 24 |
# File 'lib/mrsk/configuration/builder.rb', line 22 def remote? !!@options["remote"] end |
#remote_arch ⇒ Object
54 55 56 |
# File 'lib/mrsk/configuration/builder.rb', line 54 def remote_arch @options["remote"]["arch"] if remote? end |
#remote_host ⇒ Object
58 59 60 |
# File 'lib/mrsk/configuration/builder.rb', line 58 def remote_host @options["remote"]["host"] if remote? end |
#secrets ⇒ Object
34 35 36 |
# File 'lib/mrsk/configuration/builder.rb', line 34 def secrets @options["secrets"] || [] end |
#to_h ⇒ Object
10 11 12 |
# File 'lib/mrsk/configuration/builder.rb', line 10 def to_h @options end |