Class: Caco::Prometheus::AdapterInstallPostgresql

Inherits:
Trailblazer::Operation
  • Object
show all
Defined in:
lib/caco/prometheus/adapter_install_postgresql.rb

Instance Method Summary collapse

Instance Method Details

#build_url(ctx, version:, root:, adapter_root:) ⇒ Object



37
38
39
40
41
42
# File 'lib/caco/prometheus/adapter_install_postgresql.rb', line 37

def build_url(ctx, version:, root:, adapter_root:, **)
  ctx[:url] = "https://github.com/timescale/prometheus-postgresql-adapter/releases/download/v#{version}/prometheus-postgresql-adapter-#{version}-linux-amd64.tar.gz"
  ctx[:dest] = "#{root}/prometheus-postgresql-adapter-#{version}-linux-amd64.tar.gz"
  ctx[:current_target] = adapter_root
  ctx[:current_link] = "#{root}/postgresql-adapter-current"
end

#check_root(ctx, version:) ⇒ Object



31
32
33
34
35
# File 'lib/caco/prometheus/adapter_install_postgresql.rb', line 31

def check_root(ctx, version:, **)
  ctx[:root] = Settings.prometheus.root
  ctx[:adapter_root] = "#{Settings.prometheus.root}/postgresql-adapter-#{version}.linux-amd64"
  FileUtils.mkdir_p(ctx[:adapter_root])
end

#mkdir_target(ctx, current_target:) ⇒ Object



44
45
46
# File 'lib/caco/prometheus/adapter_install_postgresql.rb', line 44

def mkdir_target(ctx, current_target:, **)
  FileUtils.mkdir_p(current_target)
end