Class: Minos::Docker

Inherits:
Thor
  • Object
show all
Includes:
Thor::Shell
Defined in:
lib/minos/docker.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/minos/docker.rb', line 10

def build
  artifacts.each do |a|
    artifact = Artifact.new(a, options: options)
    artifact
    .on(:pulling_cache_artifact) do |name|
      say_status artifact.name, "Pulling #{name}"
    end
    .on(:building_artifact) do |name|
      say_status artifact.name, "Building #{name}"
    end
    .on(:artifact_built) do |name|
      say_status artifact.name, "Successfully built #{name}"
    end

    artifact.pull
    artifact.build
  end
end

#pushObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/minos/docker.rb', line 30

def push
  artifacts.each do |a|
    artifact = Artifact.new(a, options: options)
    artifact
    .on(:tagging_artifact) do |source, target|
      say_status artifact.name, "Successfully tagged #{source} as #{target}"
    end
    .on(:pushing_artifact) do |name|
      say_status artifact.name, "Pushing #{name}"
    end

    artifact.push
  end
end