class Luban::Deployment::Packages::Mysql::Installer

Public Instance Methods

installed?() click to toggle source
# File lib/luban/deployment/packages/mysql/installer.rb, line 21
def installed?
  return false unless file?(mysql_executable)
  pattern = Regexp.new("mysql  Ver \.* Distrib #{Regexp.escape(package_version)}")
  match?("#{mysql_executable} --version 2>&1", pattern)
end
package_dist() click to toggle source
# File lib/luban/deployment/packages/mysql/installer.rb, line 10
def package_dist; task.opts.dist; end
package_full_name() click to toggle source
# File lib/luban/deployment/packages/mysql/installer.rb, line 11
def package_full_name; "#{super}-#{package_dist}"; end
source_repo() click to toggle source
# File lib/luban/deployment/packages/mysql/installer.rb, line 13
def source_repo
  @source_repo ||= "http://dev.mysql.com"
end
source_url_root() click to toggle source
# File lib/luban/deployment/packages/mysql/installer.rb, line 17
def source_url_root
  @source_url_root ||= "get/Downloads/MySQL-#{package_major_version}"
end

Protected Instance Methods

bootstrap_install() click to toggle source
Calls superclass method
# File lib/luban/deployment/packages/mysql/installer.rb, line 29
def bootstrap_install
  super
  assure_dirs(data_path, ssl_rsa_path, 
              innodb_log_group_home_path, bin_log_path,
              error_log_path, general_log_path, slow_query_log_path)
  assure(:directory, secure_file_priv_path) do
    mkdir(secure_file_priv_path)
    chmod('750', secure_file_priv_path)
  end
end
build_package() click to toggle source
# File lib/luban/deployment/packages/mysql/installer.rb, line 50
def build_package
  info "Building #{package_full_name}"
  within install_path do
    rm('-r', '*') # Clean up install path
    execute(:mv, build_path.join('*'), '.', ">> #{install_log_file_path} 2>&1")
    execute(:"bin/mysqld", "--initialize-insecure #{compose_build_options} >> #{install_log_file_path} 2>&1")
    execute(:"bin/mysql_ssl_rsa_setup", "--datadir=#{ssl_rsa_path}", ">> #{install_log_file_path} 2>&1")
  end
end
configure_build_options() click to toggle source
Calls superclass method
# File lib/luban/deployment/packages/mysql/installer.rb, line 40
def configure_build_options
  super
  @configure_opts.delete(install_prefix)
  @configure_opts << "--user=#{user}"
  @configure_opts << "--basedir=#{install_path}"
  @configure_opts << "--datadir=#{data_path}"
  @configure_opts << "--log-error=#{error_log_file_path}"
  @configure_opts << "--innodb_log_group_home_dir=#{innodb_log_group_home_path}"
end