Class: Afterlife::Stage
- Inherits:
-
Struct
- Object
- Struct
- Afterlife::Stage
- Defined in:
- lib/afterlife/stage.rb
Instance Attribute Summary collapse
-
#bucket ⇒ Object
Returns the value of attribute bucket.
-
#cdn_url ⇒ Object
Returns the value of attribute cdn_url.
-
#name ⇒ Object
Returns the value of attribute name.
-
#region ⇒ Object
Returns the value of attribute region.
-
#registry ⇒ Object
Returns the value of attribute registry.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#bucket ⇒ Object
Returns the value of attribute bucket
4 5 6 |
# File 'lib/afterlife/stage.rb', line 4 def bucket @bucket end |
#cdn_url ⇒ Object
Returns the value of attribute cdn_url
4 5 6 |
# File 'lib/afterlife/stage.rb', line 4 def cdn_url @cdn_url end |
#name ⇒ Object
Returns the value of attribute name
4 5 6 |
# File 'lib/afterlife/stage.rb', line 4 def name @name end |
#region ⇒ Object
Returns the value of attribute region
4 5 6 |
# File 'lib/afterlife/stage.rb', line 4 def region @region end |
#registry ⇒ Object
Returns the value of attribute registry
4 5 6 |
# File 'lib/afterlife/stage.rb', line 4 def registry @registry end |
Class Method Details
.build(name = nil) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/afterlife/stage.rb', line 12 def self.build(name = nil) Stage.new( name: ENV.fetch('AFTERLIFE_STAGE', name), bucket: ENV.fetch('AWS_BUCKET', nil), region: ENV.fetch('AWS_REGION'), cdn_url: ENV.fetch('AWS_BUCKET', nil), registry: ENV.fetch('AFTERLIFE_DEPLOY_REGISTRY', nil), ) end |
.find(stage) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/afterlife/stage.rb', line 22 def self.find(stage) return build(stage) unless Afterlife.config.file_exist? unless Afterlife.config.stages.key?(stage.to_sym) fail Error, "invalid stage '#{stage}'. Possible values: #{Afterlife.config.stages.keys.map(&:to_s)}" end Afterlife.config.stages[stage.to_sym] end |
Instance Method Details
#profile ⇒ Object
32 33 34 |
# File 'lib/afterlife/stage.rb', line 32 def profile @profile ||= Afterlife::Config::Provider::CLOUD_PROFILES[name.to_sym] end |