Sha256: 77b57f9056d47d684dc31ab6a2b238ee71bb105d4d2d9b1fc4d50033176832d5
Contents?: true
Size: 1.4 KB
Versions: 1
Compression:
Stored size: 1.4 KB
Contents
require "log4r" 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 @logger.debug("Tracking deployment start to #{host}.") id = VagrantPlugins::Orchestrate::DEPLOYMENT_ID 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. See error log for 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 | lib/vagrant-managed-servers/action/track_deployment_start.rb |