Skip to content

Commit

Permalink
Disable trello build notification by default
Browse files Browse the repository at this point in the history
  • Loading branch information
hennevogel committed Apr 29, 2024
1 parent 35a44f1 commit 0dc8b97
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions dotenv.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ KURREN_NOTIFY_SLACK_OBS=true
# Default: false
KURREN_NOTIFY_SLACK_OPENQA=false

# Notify trello about failed OBS builds
# Default: false
KURREN_NOTIFY_TRELLO_OBS=false

### openQA Configuration
# Your openQA API key
# Default: none (you need to set this)
Expand Down
2 changes: 0 additions & 2 deletions lib/obs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ def notify(status:)
@trello.status = status
@trello.notify

return unless ENV.fetch('KURREN_NOTIFY_SLACK_OBS', true)

slack_message = 'Build failed for obs-server. https://build.opensuse.org/package/live_build_log/OBS:Server:Unstable/obs-server/15.5/x86_64'
@slack.notify(message: slack_message) if status == :failed
end
Expand Down
2 changes: 2 additions & 0 deletions lib/slack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class Slack
SLACK_URL = ENV.fetch('OBS_TOOLS_SLACK_URL')

def notify(message:)
return unless ENV.fetch('KURREN_NOTIFY_SLACK_OBS', 'false') == 'true'

response = Faraday.post(SLACK_URL) do |request|
request.headers['Content-Type'] = 'application/json'
request.body = { text: message }.to_json
Expand Down
2 changes: 2 additions & 0 deletions lib/trello.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Trello
attr_accessor :status

def notify
return unless ENV.fetch('KURREN_NOTIFY_TRELLO_OBS', 'false') == 'true'

change_card_content
change_card_cover
end
Expand Down

0 comments on commit 0dc8b97

Please sign in to comment.