Class: Lux::DockerImageTask
- Inherits:
-
Rake::FileTask
- Object
- Rake::FileTask
- Lux::DockerImageTask
- Defined in:
- lib/lux/docker_tasks.rb
Instance Method Summary collapse
-
#initialize(task_name, app) ⇒ DockerImageTask
constructor
This task checks to see if the image is present in the local Docker Server If present it returns the creation date as the timestamp, if not then it returns Rake::Early.
- #needed? ⇒ Boolean
- #timestamp ⇒ Object
Constructor Details
#initialize(task_name, app) ⇒ DockerImageTask
This task checks to see if the image is present in the local Docker Server If present it returns the creation date as the timestamp, if not then it returns Rake::Early. This allows dependencies to execute correctly The action block should build the container.
46 47 48 49 50 51 52 |
# File 'lib/lux/docker_tasks.rb', line 46 def initialize(task_name, app) super(task_name, app) @imagename = @name @imagename += ':latest' unless @imagename.index(':') @image = DISABLED ? nil : Docker::Image.all.select{|i| i.info['RepoTags']&.include? @imagename}.first end |
Instance Method Details
#needed? ⇒ Boolean
54 55 56 57 |
# File 'lib/lux/docker_tasks.rb', line 54 def needed? return false if DISABLED ! @image || out_of_date?() || @application..build_all end |