module DockerizeRails::DockerCommands

Public Class Methods

build() click to toggle source
# File lib/dockerize_rails/docker_commands.rb, line 26
def self.build
  DockerHelpers.ensure_docker_service
  status = 0
  status += DockerBuild.build_rails
  status += DockerBuild.build_postgres
  status += DockerBuild.build_mysql
  status
rescue Docker::Error::NotFoundError => exception
  puts
  puts exception.to_s.red
  puts
  1
end
delete() click to toggle source
# File lib/dockerize_rails/docker_commands.rb, line 66
def self.delete
  DockerHelpers.ensure_docker_service
  status = 0
  status += DockerDelete.delete_rails
  status += DockerDelete.delete_mysql
  status += DockerDelete.delete_postgres
  status
rescue Docker::Error::NotFoundError => exception
  puts exception.to_s.strip.red
  1
end
info() click to toggle source
# File lib/dockerize_rails/docker_commands.rb, line 5
def self.info
  DockerHelpers.ensure_docker_service
  puts
  DockerHelpers.print_version
  puts
end
pull() click to toggle source
# File lib/dockerize_rails/docker_commands.rb, line 12
def self.pull
  DockerHelpers.ensure_docker_service
  status = 0
  status += DockerPull.pull_ruby
  status += DockerPull.pull_mysql
  status += DockerPull.pull_postgres
  status
rescue Docker::Error::NotFoundError => exception
  puts
  puts exception.to_s.red
  puts
  1
end
start() click to toggle source
# File lib/dockerize_rails/docker_commands.rb, line 40
def self.start
  DockerHelpers.ensure_docker_service
  status = 0
  status += DockerStart.start_mysql
  status += DockerStart.start_postgres
  status += DockerStart.start_rails
  status
rescue Docker::Error::NotFoundError => exception
  puts
  puts exception.to_s.red
  puts
  1
end
stop() click to toggle source
# File lib/dockerize_rails/docker_commands.rb, line 54
def self.stop
  DockerHelpers.ensure_docker_service
  status = 0
  status += DockerStop.stop_rails
  status += DockerStop.stop_mysql
  status += DockerStop.stop_postgres
  status
rescue Docker::Error::NotFoundError => exception
  puts exception.to_s.strip.red
  1
end