module Deploy::Commands

Public Instance Methods

build_image(repo, tag) click to toggle source
# File lib/deploy/commands.rb, line 7
def build_image(repo, tag)
  shout "Building Docker Image: #{repo}:#{tag}"
  command = "docker build -t #{repo}:#{tag} ."
  exit(1) unless system(command)
end
pull_image(repo, tag) click to toggle source
# File lib/deploy/commands.rb, line 25
def pull_image(repo, tag)
  shout "Pulling Docker Image: #{repo}:#{tag}"
  command = "docker pull #{repo}:#{tag}"
  exit(1) unless system(command)
end
push_image(repo, tag) click to toggle source
# File lib/deploy/commands.rb, line 19
def push_image(repo, tag)
  shout "Pushing Docker Image: #{repo}:#{tag}"
  command = "docker push #{repo}:#{tag}"
  exit(1) unless system(command)
end
run_deploy(version, environment) click to toggle source
# File lib/deploy/commands.rb, line 31
def run_deploy(version, environment)
  command = "eb deploy #{environment} --label #{version}"
  shout "deploying #{version} to elastic beanstalk with command: #{command}"
  exit(1) unless system(command)
end
run_rollback(version, environment) click to toggle source
# File lib/deploy/commands.rb, line 37
def run_rollback(version, environment)
  command = "eb deploy #{environment} --version #{version}"
  shout "deploying #{version} to elastic beanstalk with command: #{command}"
  exit(1) unless system(command)
end
tag_image_as_latest(repo, tag) click to toggle source
# File lib/deploy/commands.rb, line 13
def tag_image_as_latest(repo, tag)
  shout "Tagging #{tag} Docker Image as Latest"
  command = "docker tag -f #{repo}:#{tag} #{repo}:latest"
  exit(1) unless system(command)
end