#root = File.dirname(__FILE__)
root = File.join(File.dirname(__FILE__), "..")
$LOAD_PATH.push root unless $LOAD_PATH.include? root

require "core/devops-config"
require "core/devops-logger"
require "core/devops-db"
require "byebug"
require "lib/knife/knife_factory"

DevopsLogger.logger = Sidekiq.logger
DevopsLogger.logger.info "Environment: " + Sidekiq.options[:environment]
DevopsConfig.read
Devops::Db.init(Sidekiq.options[:environment])

# quick workaround to load devops-nibr
require 'core/devops-messages'
require 'providers/aws/aws_connector'
require 'db/mongo/models/project'
require 'db/mongo/models/stack/stack_base'
Devops::Plugin::Nibr.init
Devops::Messages.init
KnifeFactory.init

require "providers/static"
require "providers/aws"

%w(create_server_worker deploy_worker bootstrap_worker unbootstrap_worker project_test_worker stack_bootstrap_worker delete_server_worker delete_expired_server_worker stack_sync_worker).each do |worker|
require_relative worker
DevopsLogger.logger.info "Loaded worker '#{worker}'"
end

config = {}
#require File.join(root, "../proxy")
