Sha256: 8dd31200bfb59eeff0c1f7f15c5ecf392ba451b8ba7e623ca749fe79ec88f2a3
Contents?: true
Size: 1.51 KB
Versions: 1
Compression:
Stored size: 1.51 KB
Contents
require "log4r" require "vagrant-orchestrate/version" module VagrantPlugins module ManagedServers module Action class TrackDeploymentStart def initialize(app, _env) @app = app @logger = Log4r::Logger.new("vagrant_managed_servers::action::track_deployment_start") end def call(env) track_deployment_start(env[:tracker_host], env[:status], env[:ui], env[:args]) @app.call(env) end def track_deployment_start(host, status, ui, args) return unless host id = VagrantPlugins::Orchestrate::DEPLOYMENT_ID ui.info("Deployment being tracked in deployment-tracker with ID: #{id}") @logger.debug("Tracking deployment start to #{host}.") hostname = `hostname`.chomp deployment = { deployment_id: id, engine: "vagrant_orchestrate", engine_version: VagrantPlugins::Orchestrate::VERSION, user: status.user, host: hostname, environment: status.branch, package: status.repo, package_url: status.remote_origin_url, version: status.ref, arguments: args } DeploymentTrackerClient::DefaultApi.post_deployment(id, deployment) rescue => ex ui.warn("There was an error notifying deployment tracker. Run with --debug for more details.") @logger.warn("Error tracking deployment start for deployment #{id}") @logger.warn(ex) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vagrant-orchestrate-0.7.0.pre.4 | lib/vagrant-managed-servers/action/track_deployment_start.rb |