Class: Caco::Prometheus::AdapterInstallPg

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

Instance Method Summary collapse

Instance Method Details

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



21
22
23
24
25
26
# File 'lib/caco/prometheus/adapter_install_pg.rb', line 21

def build_url(ctx, version:, root:, **)
  ctx[:url] = "https://github.com/timescale/pg_prometheus/archive/#{version}.tar.gz"
  ctx[:dest] = "#{root}/pg_prometheus-#{version}.tar.gz"
  ctx[:current_target] = "#{root}/pg_prometheus-#{version}"
  ctx[:current_link] = "#{root}/pg_prometheus-current"
end

#check_root(ctx) ⇒ Object



15
16
17
18
# File 'lib/caco/prometheus/adapter_install_pg.rb', line 15

def check_root(ctx, **)
  ctx[:root] = Settings.prometheus.root
  FileUtils.mkdir_p(Settings.prometheus.root)
end

#postgresql_shared_library(ctx) ⇒ Object



99
100
101
102
# File 'lib/caco/prometheus/adapter_install_pg.rb', line 99

def postgresql_shared_library(ctx, **)
  Caco::Postgres.add_shared_library("timescaledb")
  Caco::Postgres.add_shared_library("pg_prometheus")
end

#postgresql_should_restart(ctx) ⇒ Object



104
105
106
# File 'lib/caco/prometheus/adapter_install_pg.rb', line 104

def postgresql_should_restart(ctx, **)
  Caco::Postgres.should_restart!
end