Sha256: 9efd9d442ccadb18f332cd48bb5676e416ae7b9e445d5573aba7ce4f574a89bf

Contents?: true

Size: 870 Bytes

Versions: 6

Compression:

Stored size: 870 Bytes

Contents

#!/usr/bin/env ruby

# make sure the program is invoked through bundle exec
exec('bundle', 'exec', $PROGRAM_NAME, *ARGV) unless ENV['BUNDLE_GEMFILE']

$LOAD_PATH << File.expand_path('../lib', File.dirname(__FILE__))

SERVICE_NAME = ENV['SERVICE_NAME'] || 'sample'
require 'skalera/services'

# configures consul, errbit & airbrake
Skalera::Services.bootstrap(SERVICE_NAME)

begin
  # run your stuff here...
  influx = Skalera::Services::InfluxDB.instance('metrics')
  puts influx
  redis = Skalera::Services::Redis.instance
  puts redis
  DB = Skalera::Services::Postgres.instance('postgres')
  Skalera::Services::Credentials.for('vcenter') do |host, user, password|
    puts "#{host} / #{user} / #{password}"
  end
rescue => e
  STDERR.puts("#{e.class.name}: #{e.message}")
  STDERR.puts(e.backtrace)
  Airbrake.notify_or_ignore(e, cgi_data: ENV.to_hash)
  exit(1)
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
skalera-services-0.2.5 bin/dummy.rb
skalera-services-0.2.4 bin/dummy.rb
skalera-services-0.2.3 bin/dummy.rb
skalera-services-0.2.2 bin/dummy.rb
skalera-services-0.2.1 bin/dummy.rb
skalera-services-0.2.0 bin/dummy.rb