Class: Luban::Deployment::Packages::Grafana::Installer

Inherits:
Service::Installer
  • Object
show all
Includes:
Paths
Defined in:
lib/luban/deployment/packages/grafana/installer.rb

Instance Method Summary collapse

Methods included from Paths

#control_file_dir, #control_file_name, #data_path, #plugins_path

Instance Method Details

#build_pathObject



28
29
30
# File 'lib/luban/deployment/packages/grafana/installer.rb', line 28

def build_path
  @build_path ||= package_tmp_path.join("grafana-#{package_version}-#{package_iter}")
end

#installed?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
# File 'lib/luban/deployment/packages/grafana/installer.rb', line 22

def installed?
  return false unless file?(grafana_cli_executable)
  pattern = Regexp.new(Regexp.escape("Grafana cli version #{package_version}"))
  match?("#{grafana_cli_executable} --version 2>&1", pattern)
end

#package_distObject



11
# File 'lib/luban/deployment/packages/grafana/installer.rb', line 11

def package_dist; task.opts.dist; end

#package_full_nameObject



12
# File 'lib/luban/deployment/packages/grafana/installer.rb', line 12

def package_full_name; "grafana-#{package_version}-#{package_iter}.#{package_dist}"; end

#package_iterObject



10
# File 'lib/luban/deployment/packages/grafana/installer.rb', line 10

def package_iter; task.opts.iter; end

#source_repoObject



14
15
16
# File 'lib/luban/deployment/packages/grafana/installer.rb', line 14

def source_repo
  @source_repo ||= 'https://grafanarel.s3.amazonaws.com'
end

#source_url_rootObject



18
19
20
# File 'lib/luban/deployment/packages/grafana/installer.rb', line 18

def source_url_root
  @source_url_root ||= "builds"
end