Sha256: 4f9941a6a7645f099e00d5171b8d460a3c1cd285a9356b54e7ca74274b02c95a

Contents?: true

Size: 821 Bytes

Versions: 140

Compression:

Stored size: 821 Bytes

Contents

module Gitlab
  module QA
    module Slack
      class PostToSlack
        def initialize(message:, icon_emoji: Runtime::Env.slack_icon_emoji, channel: Runtime::Env.slack_qa_channel)
          @channel = channel
          @message = message
          @icon_emoji = icon_emoji
        end

        def invoke!
          Runtime::Env.require_slack_qa_channel! unless @channel
          Runtime::Env.require_ci_slack_webhook_url!

          params = {}
          params['channel'] = @channel
          params['username'] = "GitLab QA Bot"
          params['icon_emoji'] = @icon_emoji
          params['text'] = @message

          url = Runtime::Env.ci_slack_webhook_url

          Support::HttpRequest.make_http_request(method: 'post', url: url, params: params, show_response: true)
        end
      end
    end
  end
end

Version data entries

140 entries across 140 versions & 1 rubygems

Version Path
gitlab-qa-7.34.0 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.33.0 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.32.0 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.31.0 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.30.0 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.29.1 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.29.0 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.27.2 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.27.1 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.27.0 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.26.0 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.25.1 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.25.0 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.24.6 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.24.5 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.24.4 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.24.3 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.24.2 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.24.1 lib/gitlab/qa/slack/post_to_slack.rb
gitlab-qa-7.24.0 lib/gitlab/qa/slack/post_to_slack.rb