lib/vidar/cli.rb in vidar-0.9.0 vs lib/vidar/cli.rb in vidar-0.10.0
- old
+ new
@@ -116,23 +116,18 @@
revision: Config.get!(:revision),
revision_name: Config.get!(:revision_name),
deploy_config: deploy_config
)
- sentry_notification = SentryNotification.new(
- revision: Config.get!(:revision),
- deploy_config: deploy_config
- )
-
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?
- sentry_notification.call if sentry_notification.configured?
+ invoke :notify_sentry
else
Log.error "ERROR: Some of containers are errored or not ready"
slack_notification.failure if slack_notification.configured?
exit(1)
end
@@ -168,8 +163,18 @@
desc "console", "Execute console command in the first running pod"
method_option :command, required: false
method_option :name, required: false
def console
invoke :kube_exec, name: options[:name], command: options[:command] || Config.get!(:kubectl_context)
+ end
+
+ desc "notify_sentry", "Notify sentry about current release"
+ def notify_sentry
+ sentry_notification = SentryNotification.new(
+ revision: Config.get!(:revision),
+ deploy_config: Config.deploy_config
+ )
+
+ sentry_notification.call if sentry_notification.configured?
end
end
end