Class: Shipper::Service
- Inherits:
-
Object
- Object
- Shipper::Service
- Defined in:
- lib/shipper/service.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(name, options) ⇒ Service
constructor
A new instance of Service.
- #ship! ⇒ Object
Constructor Details
#initialize(name, options) ⇒ Service
Returns a new instance of Service.
7 8 9 10 11 |
# File 'lib/shipper/service.rb', line 7 def initialize(name, ) @name = name @options = @path = "#{Dir.pwd}/#{['path']}" end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/shipper/service.rb', line 5 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/shipper/service.rb', line 5 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/shipper/service.rb', line 5 def path @path end |
Instance Method Details
#ship! ⇒ Object
13 14 15 16 17 18 |
# File 'lib/shipper/service.rb', line 13 def ship! executor.cd(path) ['before_build']&.each { |cmd| exec(cmd) } exec "docker build . -t #{.fetch('repo')} #{build_args}".strip exec "docker push #{.fetch('repo')}" end |