2014-10-29 03:54:16 +00:00
|
|
|
require "vagrant"
|
|
|
|
|
|
|
|
module VagrantPlugins
|
2014-11-12 20:49:55 +00:00
|
|
|
module AtlasPush
|
2014-10-29 16:39:26 +00:00
|
|
|
autoload :Errors, File.expand_path("../errors", __FILE__)
|
|
|
|
|
2014-10-29 03:54:16 +00:00
|
|
|
class Plugin < Vagrant.plugin("2")
|
2014-11-12 20:49:55 +00:00
|
|
|
name "atlas"
|
2014-10-29 03:54:16 +00:00
|
|
|
description <<-DESC
|
2014-11-12 20:49:55 +00:00
|
|
|
Deploy using HashiCorp's Atlas service.
|
2014-10-29 03:54:16 +00:00
|
|
|
DESC
|
|
|
|
|
2014-11-12 20:49:55 +00:00
|
|
|
config(:atlas, :push) do
|
2014-10-29 16:52:06 +00:00
|
|
|
require_relative "config"
|
2014-10-29 16:41:47 +00:00
|
|
|
init!
|
2014-10-29 03:54:16 +00:00
|
|
|
Config
|
|
|
|
end
|
|
|
|
|
2014-11-12 20:49:55 +00:00
|
|
|
push(:atlas) do
|
2014-10-29 16:52:06 +00:00
|
|
|
require_relative "push"
|
2014-10-29 16:41:47 +00:00
|
|
|
init!
|
2014-10-29 03:54:16 +00:00
|
|
|
Push
|
|
|
|
end
|
2014-10-29 16:41:47 +00:00
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def self.init!
|
|
|
|
return if defined?(@_init)
|
2014-11-12 22:14:58 +00:00
|
|
|
I18n.load_path << File.expand_path("../locales/en.yml", __FILE__)
|
2014-10-29 16:41:47 +00:00
|
|
|
I18n.reload!
|
|
|
|
@_init = true
|
|
|
|
end
|
2014-10-29 03:54:16 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|