lib/vidar/cli.rb in vidar-1.6.0 vs lib/vidar/cli.rb in vidar-1.7.0
- old
+ new
@@ -76,10 +76,11 @@
Log.info "Looking for deploy hook..."
template_name, error, status = Open3.capture3 "kubectl get cronjob deploy-hook-template -n #{Config.get!(:namespace)} -o name --ignore-not-found=true"
slack_notification = SlackNotification.get
+ honeycomb_notification = HoneycombNotification.get
if status.success?
if template_name.to_s.empty?
Log.info "No deploy hook found"
else
@@ -94,16 +95,18 @@
unless deploy_status.success?
Run.kubectl "describe job deploy-hook"
Log.error "Error running deploy hook template"
slack_notification.failure if slack_notification.configured?
+ honeycomb_notification.failure
exit(1)
end
end
else
Log.info "Error getting deploy hook template: #{error}"
slack_notification.failure if slack_notification.configured?
+ honeycomb_notification.failure
exit(1)
end
destination = options[:destination]
container = options[:container]
@@ -125,22 +128,25 @@
def monitor_deploy_status
Log.info "Current kubectl context: #{Config.get!(:kubectl_context)}"
Log.info "Checking if all containers in #{Config.get!(:namespace)} namespace(s) are ready..."
slack_notification = SlackNotification.get
+ honeycomb_notification = HoneycombNotification.get
deploy_status = Vidar::DeployStatus.new(namespace: Config.get!(:namespace))
deploy_status.wait_until_completed
if deploy_status.success?
Log.info "OK: All containers are ready"
slack_notification.success if slack_notification.configured?
+ honeycomb_notification.success
invoke :notify_sentry
else
Log.error "ERROR: Some of containers are errored or not ready"
slack_notification.failure if slack_notification.configured?
+ honeycomb_notification.failure
exit(1)
end
end
desc "kube_exec", "Execute given command in the first running pod"
@@ -191,9 +197,14 @@
revision: Config.get!(:revision),
deploy_config: Config.deploy_config
)
sentry_notification.call if sentry_notification.configured?
+ end
+
+ desc "notify_honeycomb", "Send test honeycomb notification"
+ def notify_honeycomb
+ HoneycombNotification.get.success
end
method_option :message, required: true
desc "notify_slack", "Send custom slack notification"
def notify_slack