class DockerDeploy::Context

Attributes

env_files[R]
ports[R]
stages[R]
variables[R]

Public Class Methods

new() click to toggle source
# File lib/docker_deploy/context.rb, line 5
def initialize
  @stages = []
  @env_files = []
  @variables = {}
  @ports = {}
  @links = {}
end

Public Instance Methods

container(name = nil) click to toggle source
# File lib/docker_deploy/context.rb, line 34
def container(name = nil)
  @container = name if name
  @container or @image.split("/").last
end
env(variables = {}) click to toggle source
# File lib/docker_deploy/context.rb, line 13
def env(variables = {})
  @variables.merge!(variables)
end
env_file(env_file) click to toggle source
# File lib/docker_deploy/context.rb, line 25
def env_file(env_file)
  @env_files.push(env_file)
end
image(name = nil) click to toggle source
# File lib/docker_deploy/context.rb, line 29
def image(name = nil)
  @image = name if name
  @image
end
local(&block) click to toggle source
# File lib/docker_deploy/context.rb, line 43
def local(&block)
  stage = LocalStage.new(self)
  stage.instance_eval(&block)
  @stages << stage
end
port(ports = {}) click to toggle source
# File lib/docker_deploy/context.rb, line 17
def port(ports = {})
  @ports.merge!(ports)
end
revision() click to toggle source
# File lib/docker_deploy/context.rb, line 39
def revision
  @revision ||= `git rev-parse HEAD`.chomp[0...8]
end
stage(name, &block) click to toggle source
# File lib/docker_deploy/context.rb, line 49
def stage(name, &block)
  stage = RemoteStage.new(self, name)
  stage.instance_eval(&block)
  @stages << stage
end